Tham khảo tài liệu 'expert sql server 2008 development- p3', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | CHAPTER 4 ERRORS AND EXCEPTIONS Error Level The Level tag within an error message indicates a number between 1 and 25. This number can sometimes be used to either classify an exception or determine its severity. Unfortunately the key word is sometimes the error levels assigned by SQL Server are highly inconsistent and should generally not be used in order to make decisions about how to handle exceptions. The following exception based on its error message is of error level 15 Msg 156 Level 15 State 1 Line 1 Incorrect syntax near the keyword FROM . The error levels for each exception can be queried from the view using the severity column. A severity of less than 11 indicates that a message is a warning. If severity is 11 or greater the message is considered to be an error and can be broken down into the following documented categories Error levels 11 through 16 are documented as errors that can be corrected by the user. The majority of exceptions thrown by SQL Server are in this range including constraint violations parsing and compilation errors and most other runtime exceptions. Error levels 17 through 19 are more serious exceptions. These include out-ofmemory exceptions disk space exceptions internal SQL Server errors and other similar violations. Many of these are automatically logged to the SQL Server error log when they are thrown. You can identify those exceptions that are logged by examining the is_event_logged column of the table. Error levels 20 through 25 are fatal connection and server-level exceptions. These include various types of data corruption network logging and other critical errors. Virtually all of the exceptions at this level are automatically logged. Although the error levels that make up each range are individually documented in Books Online http en-us library this information is inconsistent or incorrect in many cases. For instance according to documentation severity level 11 .