Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exception Handling Information

2 views
Skip to first unread message

navin...@credit-suisse.com

unread,
Nov 21, 2006, 2:23:30 PM11/21/06
to
Hello,
I am a. NET developer and want to understand Excpetion Handling in
T-SQL ( Sybase v 12.5)

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

0 new messages