How to easily understand the format of SQL Server error messages

Source: Internet
Author: User
All MicrosoftSQLServer2000 components can send messages, warnings, or error messages to applications. Most SQLServer information returned to the application contains the following parts: ◆ the error number identifies one to five digits of the message. The error code of a user-defined message can contain multiple digits. ◆ Description of Unicode characters

All Microsoft SQL Server 2000 components can send messages, warnings, or error messages to applications. Most of the SQL Server Information returned to the application contains the following parts: ◆ the error number identifies one to five digits of the message. The error code of a user-defined message can contain multiple digits. ◆ Description of Unicode characters

AllMicrosoft®SQL Server™2000 all components can be sent to the applicationInformation, Warning orErrorInformation. Most SQL servers returned to the applicationInformationIt includes the following parts:

ErrorNo.

One to five digits are used to identify the message. User-defined messageErrorNumber can contain multiple digits.

◆ Description

Unicode string that contains conditions for message generationInformation.

◆ Severity Level

IndicatesErrorOne or two digits of the severity of a condition.

◆ Status

A one-to-three-digit number with a maximum value of 127 indicates to Microsoft support engineers and developers where the message is generated in SQL Server code:

◆ Row number

A number in a batch or stored procedure (containing the message generation Statement. The row number can also be included in the Stored Procedure text.

For most SQL Server messagesErrorIDs, descriptions, and severity levels are stored in master. dbo. sysmessages. The status and line number are dynamically generated by the code that sends the message.

Messages generated in the customer's Net-Library, Microsoft ole db provider for SQL Server, or SQL Server ODBC driver do not contain Message Components.

To seeErrorInformationFor example, run the following statement:

The following is a reference clip:
SELECT * FROM ThisObjectDoesNotExist

TheErrorHas the following parts:

  ErrorNumber: 208

Severity Level: 16

Status: 1

Row: 1

Description: The object name 'thisobjectdoesnotexist' is invalid.

All data APIs used by applications to access SQL Server are returned.ErrorNumber and description. Not all APIs return a severity level, status, or line number. Only when you write an ole db or ODBC application, you can use the specific diagnostic functions of the Microsoft ole db provider for SQL Server and the SQL Server ODBC driver, the Microsoft ole db provider for SQL Server and the SQL Server ODBC driver will return these parts.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.