Handle Error in Stored Procedures

Database
Enthusiast

Handle Error in Stored Procedures

Hi all,
I've a problem in handling a generic execution error in a stored procedure.
For example: I've to do a procedure that performs a delete and, after the delete, a sequence of insert in one single table; if I want to catch a generic blocking error (like net problems, dropped tables, etc...) and insert a row in a log table by calling an other stored procedure, like insert_log(param1,param2,...,paramN), how I can do this?

The parameter list of the insert_log procedure contains all the informations I want to insert in the log table.

I hope anyone understand my not good english.

Thanks
1 REPLY
Enthusiast

Re: Handle Error in Stored Procedures

I'm sorry, I forget one thing: the procedure must be blocked when an error occurs during execution.

Thanks