Skip to Content
avatar image
Former Member

How to capture stored procedure's error log into table

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

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.

    Add comment
    10|10000 characters needed characters exceeded