How to get error description from @@error | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

How to get error description from @@error

Hi,
In a proc, how do i get the error description for the error?
We can get the error code via @@error but how do we get the exact description/ Thanks.
You can capture a SQL error within a stored procedure or within your client development tool.
This is where TRY..CATCH in SQL 2005 comes:http://www.aspfree.com/c/a/MS-SQL-Server/Exception-Handling-in-SQL-Server-2000-and-2005/ link andhttp://www.sqlservercentral.com/col…ringtheerrordescriptioninastoredprocedure.asp fyi. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
This might as well be helpful. http://www.sommarskog.se/error-handling-I.html#Yukon
http://www.sommarskog.se/error-handling-II.html
Name
———
Dilli Grg (1 row(s) affected)
]]>