Get List Of All Error Codes In SQL Server 2008

In this article I will tell you how to to get list of error codes and messages in SQL Server.
  • 10032

In this article I will tell you how to to get list of error codes and messages in SQL Server. SQL Server displays the error message on the user's screen. Each error message has an corresponding error number which uniquely specifies the type of error.

We can get all the error messages as follows:

USE master

GO

SELECT * FROM dbo.sysmessages

This will return Error numbers that uniquely identifies the error, Severity level which defines nature of the error, Dlevel is used for internal purpose,  Description defines explanation of the error that occurred and Mslangid is system message group ID.

Result:

errorMessageIn SQL.jpg

Note: We can also create user defined error message using system stored procedure. You can follow from here: Creating User Defined Error Message In SQL Server 2008.

© 2019 DotNetHeaven. All rights reserved.