1

I have a SQL Server Agent job that has three steps with the following control flow:

  • Step 1 - on success - Go to next Step. on fail - job fails
  • Step 2 - on success - Go to next Step. on fail - Go to next Step
  • Step 3 - on success - report success, on fail - report fail

However, What I want to happen is, if step 2 fails, run step 3 but report that the job has failed (regardless of whether step 3 is successful or not)

The only way I can think to do this is as per the screenshot below which duplicates the final step but the duplicate step reports failure if it succeeds

enter image description here

Is there a better way of doing this?

1

What I usually do is just add one more step "Error" between step #2 and #3 that sends an email. Something like this: enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.