SQL Server Agent Job Failure Notification

  • Basic question here.

    I want to be notified via email any time any job step fails on my SQL Server instance.

    Without modifying each job to add a step to send email on a step failure, how would I do this?

    Thank you in advance.

    Alan.

  • You could setup a query to find the jobhistory the last day and list out which has been successful or not. I guess not successful is what you want and email the outcome to you. If you have a large number of jobs this would do the trick I guess.

    Check out what the Princess opinion is...

    http://tsqlprincess.wordpress.com/2011/03/03/take-those-jobs-and-check-em/

  • You can try with the job wizard to notify the failures.

  • Have a look at this video :

    http://techsatwork.com/blog/?p=1250

    It will show you how to set up database mail and then parameter job failure notification by email.

  • Without modifying each job to add a step to send email on a step failure, how would I do this?

    I guess altering each job is too time consuming. Thats why I suggested to check the jobhistory in msdb and get a list of failed jobs.

  • It's time consuming if you do it manually.

    - But you could do it using the UI for one job (adding an extra step to send email or modify if email notification has to be sent or not)

    - then get the script which is generated

    - then run a query like following :

    select 'beginning of the script bla bla bla ... ' + name + ' bla bla bla end of the script' from msdb..sysjobs

    - and finally execute the result.

  • Thank you everyone for the replies. I was looking for more of an alert than waiting for a job to run to show me failed jobs. That is the best solution.

    Sorry I didn't get back yesterday. Got an ankle sprain Monday night, back at work, rehabing ankle too. 🙂

    Al

Viewing 7 posts - 1 through 6 (of 6 total)

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