Running a job with Multi-Steps

  • Here is the problem. I have  job which has 10 steps. Every step, except for the last has "quit on Success" and "Quit with failure".

    The problem is that each step runs a procedures which executes multiple lines in a loop which could succeed or fail. Everytime any line fails the job goes to the next step. I want one job to complete the entire loop irrespective of success ot failure. and then go to the next step.

     

    Any help would be higly appriciated..

     

    Thanks

    N

  • Nirmal

    It's not the job that's the problem - it's the SQL within the jobstep.  You need to change it so that it includes some error handling that will make it continue instead of stop when it encounters an error.  Without some more information on what the job does, I can't be more specific than that.

    John

  • John,

    Thanks for the response. Here is what the job is intended to do. We have around 10 database in a readonly mode and the reason for it to like that is that we need to apply transaction logs on a daily basis from our production site. So, what this job does is that it runs a procedure which create a string of command for each .trn file, to apply the log from a given directory, so for each day we can have over 10 logs per database.

    There is a job which has 10 such steps for each database. So everytime one transaction log fails to apply due to any reason the job skips to next step. I want to avoid this.

    Thanks

    N

  • Nirmal

    What is failing - the building of the string or the actual restore of the log?

    John

  • It is the Job which is failing.

    N

  • Nirmal

    You're going to have to help me out with some error messages... right-click on the job and choose View Job History.  Tick the Show step details box.  Click on a step that has failed and tell me what it says in the error text at the bottom.

    Thanks

    John

Viewing 6 posts - 1 through 5 (of 5 total)

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