Error messages and message numbers

The combination of message number (error) and language ID (langid) uniquely identifies each error message. Messages that share the same message number but have different language IDs indicate translations.

select error, description, langid 
from sysmessages 
where error = 101
error description                            langid
----- -------------------------------------- ------
  101 Line %d: SQL syntax error.               NULL
  101 Ligne %1!: erreur de syntaxe SQL.           1
  101 Zeile %1!: SQL Syntaxfehler.                2

(3 rows affected)

The error message text describes the problem. The descriptions often include a line number, a reference to a type of database object (a table, column, stored procedure, and so forth), or the name of a particular database object.

In the description field of sysmessages, a percent sign (%) followed by a character or character string serves as a placeholder for these pieces of data, which Adaptive Server supplies when it encounters the problem and generates the error message. “%d” is a placeholder for a number; “%S_MSG” is a placeholder for a type of database object; “%.*s”—all within quotes—is a placeholder for the name of a particular database object. Table 12-1 lists placeholders and what they represent.

For example, the description field for message number 103 is:

The %S_MSG that starts with '%.*s' is too long. Maximum length is %d. 

The actual error message that appears to a user might be:

The column that starts with 'title' is too long. Maximum length is 80. 

For errors that you report to Technical Support, include the numbers, object types, and object names. (See “Reporting errors”.)