how to handle error in sqlserver (functions)
how to handle error in sqlserver (functions).
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sukesh MarlaPosted Sep 18, 2012, 5:46 AM
You can use Try Catch block as
BEGIN TRY
// SQL Statements
END TRY
BEGIN CATCH
Select ERROR_NUMBER() ,
ERROR_STATE() ,
ERROR_SEVERITY() ,
ERROR_LINE() ,
ERROR_PROCEDURE() ,
ERROR_MESSAGE()
END CATCH
Check this is correct answer if it helped