sample is below shows how to declare try catch blocks in t-sql syntax
(if try block is declared catch block must be declared also..)
BEGIN TRY
PRINT 'in try block'
RAISERROR ('demo exception',11,1)
END TRY
BEGIN CATCH
PRINT 'in catch block'
END CATCH
No comments:
Post a Comment