Ignoring INSERT errors in job steps

  • Hi Everyone,

    I'm running 2 stored procedures in a single job step.

    The second procedure involves a couple of cursors. A major one and a lesser one nested inside this outer one.

    At the moment when an INSERT operation error occurs on the current row being processed in the outer cursor I write the error to a table and carry on to the next row.

    This seems to work fine when I run the procedure through Query Analyzer(exec sp_Items).

    However when I run the procedure through Enterprise Manager in a job step the job quits as soon as it encounters the first INSERT operation.

    So I get one entry in my Error Log table and the process stops there. The rest of my items are never pulled across.

    Is there any way I can set SQL Server Agent to carry on through these INSERT errors????

    Help

    Nathan

  • See the post on this site:

    Jobs - embed TSQL or Call Stored Procedure??

    Posted 3/15/2004 7:12:00 AM

    Looks like someone with the same problem but I don't think they attained a complete solution.

    Rather than persevering with a workaroubnd for the problem, I think you will be better off filtering out the error before your procedure starts by cleaning the source data accordingly in a staging area.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Cheers Jonathan I'll have a look

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply