Like .NET, does T-SQL provide a try ... catch block ?
Checking @@error is one way, but requires coding after each sql
statement.
insert into .....
if @@error <> 0
Begin
select 'SQL failed'
goto errorHandler
End
errorHandler:
....(log into error table)...
Raise Error "SQL Failed"
Like Catch block in .NET, does check on @@error suppress the errors ?
(which would mean that in errorHandler, explicit exception needs to be
raised
using Raise Error)
or Error Suppresion depends on the category of the error?
Thanks