Skip to main content

View SQL Server error numbers and messages that are contained within an instance of SQL.

-- ===========================================================================
-- Get SQL Server Error Numbers and Messages
--
-- View SQL Server error numbers and messages that are contained within an
-- instance of SQL.
-- ===========================================================================

-- To get all SQL error messages in English-US:
select * from sys.messages where language_id = 1033;

-- ===========================================================================
-- Severity Level Of System And User Defined Messages
--
-- Severity Level    Description
-- ---------------------------------------------------------------------------
-- 0-9.............: Informational messages status only and are not logged.
-- 10..............: Informational messages status information. Not logged
-- 11-16...........: Error can be corrected by the user. Not logged.
-- 17-19...........: Software errors that cannot be corrected by the user.
--                   Errors will be logged.
-- 20-24...........: System problem and are fatal errors. Errors can affect all
--                   processes accessing data in the same database. Errors will
--                   be logged.
-- ===========================================================================