Messages Returned by SQL Server Utilities

Troubleshooting SQL Server

Troubleshooting

Messages Returned by SQL Server Utilities

All of the Microsoft® SQL Server™ 2000 utilities use ODBC except for the isql command prompt utility. This has effects on the way error messages are displayed by the ODBC-based utilities:

  • The error messages may have leading ODBC headers built into the description. These headers identify the component raising the error. The osql command prompt utility returns the ODBC headers. SQL Query Analyzer defaults to removing the ODBC headers, but users can set a connection option so that these are returned.

    For example, isql returns the error 208 description as:

Invalid object name 'ThisObjectDoesNotExist'.

osql includes the ODBC headers in the description:

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'ThisObjectDoesNotExist'.

The presence of the ODBC headers in the message does not necessarily indicate that the problem is in the ODBC components. The SQL Server ODBC driver includes these headers in messages from all components. For more information about how to determine the component raising the error, see ODBC Error Message Format.

  • Errors raised within the SQL Server ODBC driver have only a description. They have no error number, state, severity level, or line number. For example, if the following statement is executed in SQL Query Analyzer, the SQL Server ODBC driver itself raises a syntax error:
    { CLL sp_who }
    

    Because the driver generates the error, the only message part displayed by SQL Query Analyzer is the description:

[Microsoft][SQL Server ODBC Driver]Syntax error or access violation

See Also

isql Utility

osql Utility

sysmessages