Error Message Formats

All of the Microsoft® SQL Server™ components can issue informational, warning, or error messages to applications. Most SQL Server messages returned to applications have these parts:

The error numbers, descriptions, and severity levels for most SQL Server messages are stored in master.dbo.sysmessages. The state and line numbers are generated dynamically by the code issuing the message.

Messages raised in the client Net-Libraries, the Microsoft OLE DB Provider for SQL Server, or the SQL Server ODBC driver do not have some of these message parts.

An example of an error message can be seen by executing the statement:

SELECT * FROM ThisObjectDoesNotExist

  

This statement raises an error with these parts:

Error number: 208

Severity level: 16

State: 1

Line: 1

Description: Invalid object name 'ThisObjectDoesNotExist'.

All of the data APIs used by applications to access SQL Server return the error number and description. Not all of the APIs return the severity level, state, or line number. The OLE DB Provider for SQL Server and the SQL Server ODBC driver return these parts only if an OLE DB or ODBC application has been written to use SQL Server-specific diagnostic features exposed by the provider and driver.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.