Server message fields

The SERVERMSG structure contains the following two key fields that should be processed by the application program:

You can find the error message numbers and text returned from SQL Server by querying and/or printing the SQL Server SYSMESSAGES table, which contains copies of all the error messages that SQL Server returns.