Capturing error messages in SQL Server | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Capturing error messages in SQL Server

I want to capture error messages from within a stored procedure and parse it to extract table names and constraints from the message.Which could be used to feed the same stored proc again for recursive programming.It looks like this is not possible as BOL says. @@ERROR is the only part of a Microsoft® SQL Server™ 2000 error available within the batch, stored procedure, or trigger that generated the error. All other parts of the error, such as its severity, state, and message text containing replacement strings such as object names, are returned only to the application in which they can be processed using the API error handling mechanisms Does anyone know of an alternative way of doing it ?