SQL Agent Job - Track Failure information

  • Hello.

    I have a SQL Agent job with the following steps:

    1. Process 'ABC' Logic (SSIS Package)

    On success: Next step.

    On failure : Go to step 4.

    2. Process 'XYZ' Logic (SP)

    On success: Next step.

    On failure : Go to step 4.

    3. Success Email (EXEC msdb.dbo.sp_send_dbmail)

    On success: Complete the job showing success.

    On failure : Go to step 4.

    4. Failure Email (EXEC msdb.dbo.sp_send_dbmail)

    On success: Complete the job showing failure.

    On failure : Complete the job showing failure.

    Now, what I would like to do would be to include failure information in the email that would be generated if the job fails at any step. This would (hopefully) include the step that failed as well as the failure message. Since the email is getting generated from the failure step, how can I still have access to this information to supply the email?

    Thanks.

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

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