There are lots of companies,business have already upgraded to SQL Server 2005 ,definetly it makes sense because MS has introduced lots of new featuers. One of the many is how we can handle errors in SQL Server 2005
This procedure can be executed in your CATCH block.
CREATE PROCEDURE ErrorDetails
ERROR_NUMBER() AS ErrorNumber,
ERROR_SEVERITY() AS ErrorSeverity,
ERROR_STATE() AS ErrorState,
ERROR_PROCEDURE() AS ErrorProcedure,
ERROR_LINE() AS ErrorLine,
ERROR_MESSAGE() AS ErrorMessage;
Connect to Object Explorer and execute the following code
Great thing that we can catch more errors by usig TRY ...CATCH block and what's more important to get an error message out.