Sunday, January 27, 2013

How to send email notification when job fails on SQL server 2008

Problem

On a new SQL server 2008 system we deployed a job that runs on a regular schedule. The job contacts remote servers and when there is a connection problem we would like to be notified.

Solution

3 configurations are necessary

  • Database Mail Configuration Wizard
    • sp_CONFIGURE 'show advanced', 1
      GO
      RECONFIGURE
      GO
      sp_CONFIGURE 'Database Mail XPs', 1
      GO
      RECONFIGURE
      GO



  • Set the Mail Profile for SQL Server Agent


  • Create a SQL server agent Operator

No comments: