sys.messages (Transact-SQL)
Collapse the table of content
Expand the table of content

sys.messages (Transact-SQL)


Updated: June 10, 2016

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Contains a row for each message_id or language_id of the error messages in the system, for both system-defined and user-defined messages. For more information, see sp_addmessage (Transact-SQL).

Column nameData typeDescription
message_idintID of the message. Is unique across server. Message IDs less than 50000 are system messages.
language_idsmallintLanguage ID for which the text in text is used, as defined in syslanguages. This is unique for a specified message_id.
severitytinyintSeverity level of the message, between 1 and 25. This is the same for all message languages within a message_id.
is_event_loggedbit1 = Message is event-logged when an error is raised. This is the same for all message languages within a message_id.
textnvarchar(2048)Text of the message used when the corresponding language_id is active.

Requires membership in the public role. For more information, see Metadata Visibility Configuration.

THROW (Transact-SQL)
Catalog Views (Transact-SQL)
Messages (for Errors) Catalog Views (Transact-SQL)
Exception Message Box Programming
Error Messages
Database Engine Events and Errors

Community Additions

© 2016 Microsoft