Skip to Content

How to capture stored procedure's error log into table

Apr 17, 2017 at 10:17 AM


avatar image
Former Member

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..

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Apr 18, 2017 at 08:46 AM

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.

10 |10000 characters needed characters left characters exceeded