cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture stored procedure's error log into table

Former Member
0 Kudos

Hi Experts,

I need one help actually my requirement is i have to use one stored procedure into my job which is nothing but a simple query to create table in the database.If any error occurred in stored procedure during the job execution how to capture that error info into a control table please suggest.

Thanks in advance..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can catch the error using TRY-CATCH. In the CATCH block you can use 'error_message( )' for catching error occurred during execution of the stored procedure.

The 'error_message( )' will provide you all type of error during execution including sql statement error.

Thus you can capture and insert the error message into your control table with your own logic.

Answers (0)