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
Is there a better way of doing this?