Sql-server – Altering failed job email

database-mailjobssql serversql-server-agent

I'm looking for a simple solution: if you have a job with multiple steps and one step fails but the job is set to continue, is there a way for the SQL Agent email to say which step(s) in the process failed?

Something more than "One or more of the job steps in the job was not successful."

I'm sure I can add another step that queries the job history table and sends another email but I'm trying to combine the default email with a bit more information.

Best Answer

I've always done this by making a step's next action on failure be a specific step that sends an e-mail about that step only, then that step's on complete action is to continue to {failure step + 1}. Yes it requires some manual interaction with the jobs up front, but I can't think of any way to change the defaults without some level of manual tinkering.