Saturday 12 March 2011

SQL Error Severity and Level Cheat Sheet

Sometimes I have to raise errors manually inside a stored procedure. It will be handy to have an error severity cheat sheet.

Code Description
1 - 9Informational messages/warnings.
10N/A. @@ERROR won't be set.
11 - 16Regular programming errors. Level 16 is not more serious than 11
11Specified Database Object Not Found
12Unused
13User Transaction Syntax Error. E.g. deadlock.
14Insufficient Permission
15Syntax Error in SQL Statements
16Miscellaneous User Error
17Run out of a configurable resource, such as locks
18Nonfatal internal software problems
19Nonconfigurable resource limit has been exceeded
20An error with a statement issued by the current process
21SQL Server has encountered a problem that affects all the processes in a database
22A table or index has been damaged
23The integrity of the entire database is affected and the database will be marked suspect
24Hardware problem
25System error

No comments: