How SAP ASE Uses Error Messages

SAP ASE displays an error message when it encounters a problem.

The error message includes:

See the Configuration Guide for your platform for a description of the error log format.

For example, if you try to access a table that does not exist, you see:

select * from publisher
Msg 208, Level 16, State 1: 
publisher not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).

There may be more than one error message for a single query. If there is more than one error in a batch or query, SAP ASE usually reports only the first one. Subsequent errors are reported the next time you execute the batch or query.

Error messages are stored in master..sysmessages, which is updated with each new version of SAP ASE (and has thousands of rows). Here are the first few rows (from an SAP ASE that uses us_english as the default language):

select error, severity, description 
from sysmessages 
where error >=101 and error <=106
and langid is null
error severity description
----- -------- --------------------------------------------------
  101       15 Line %d: SQL syntax error.
  102       15 Incorrect syntax near '%.*s'.
  103       15 The %S_MSG that starts with ’%.*s’ is too long.
               Maximum length is %d.
  104       15 Order-by items must appear in the select-list if
               the statement contains set operators.
  105       15 Unclosed quote before the character string '%.*s'.
  106       16 Too many table names in the query. The maximum
               allowable is %d.
You can query sysmessages to generate a custom list of error messages: