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.
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