Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 TRY & CATCH

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2009-07-23 : 15:52:37
i am catching error's in a STORED PROCEDURE using TRY/CATCH.

I want to continue receiving errors in certain instances while still using TRY/CATCH


what is the right way to do it?

Thanks
Peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-23 : 16:06:22
There are error functions available to the catch block:
ERROR_NUMBER(): Returns a number associated with the error.

ERROR_SEVERITY(): Returns the severity of the error.

ERROR_STATE(): Returns the error state number associated with the error.

ERROR_PROCEDURE(): Returns the name of the stored procedure or trigger in which the error occurred.

ERROR_LINE(): Returns the line number inside the failing routine that caused the error.

ERROR_MESSAGE(): Returns the complete text of the error message.



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -