• Again, a job is one way to do this.

    See "Set Job Step Success or Failure Flow" - http://msdn.microsoft.com/en-us/library/ms177461.aspx - Conditions for optional execution.

    I tried to elaborate more on the tasks.

    Psuedo Code:

    Create Job A

    Create Step 1, Call Stored Procedure 1

    Create Step 2, Call Stored Procedure 2

    Create Step 3, Call Stored Procedure 3

    Here is where all the magic happens! Look at Job Step Properties dialog box, select the Advanced page.

    Step 1 - On success, exit with success code.

    Step 1 - On Failure, goto step 2

    Step 2 - On success, exit with success code.

    Step 2 - On Failure, goto step 3

    Step 3 - On success, exit with success code.

    Step 3 - On Failure, exit with failure.

    This should execute one, two or three steps depending upon the return value of each stored procedure call.

    Sincerely

    John Miner
    Crafty DBA
    www.craftydba.com