SQLGetDiagRec returns a native error code. Is there anywhere an overview of the error codes of SQL Server 2012? I couldn\'t find anything on MSDN.
I was also looking for a list myself and found out that you could view them all from the master DB by running this statement:
SELECT * FROM sysmessages
I'm unable to find a list of the individual codes in the internet. However I did find a list of the severity levels here on MSDN. They are as follows:
Severity level / Description
use master
select * from sysmessages
In SQL Server 2005 and above you can use this:
SELECT * FROM sys.messages
As others have mentioned, you can also use (available in SQL Server 2000):
SELECT * FROM sysmessages
I found the codes for MS SQL Server 2008 R2, but most of them are true for the later versions: http://technet.microsoft.com/en-us/library/cc645603(v=sql.105).aspx