⌘BABAKOV.NET Let's code!
100% [dark] [ru]
~/posts $

2010-04-14

1 total

Example of Error Catching in MSSQL

Example of how to catch errors in MSSQL. BEGIN TRY -- Some code that will return an error for example. SELECT 1/0; END TRY BEGIN CATCH 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; END CATCH

18 views 0 comments 0 likes ./Read →