SQL Server 2005 introduced better error handling than @@Error.
In the Catch block execute a select statement that returns the error information.
http://msdn.microsoft.com/en-us/libr...6(SQL.90).aspxCode:SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_SEVERITY() AS ErrorSeverity, ERROR_STATE() as ErrorState, ERROR_PROCEDURE() as ErrorProcedure, ERROR_LINE() as ErrorLine, ERROR_MESSAGE() as ErrorMessage;




Reply With Quote