Emailing the operator

Not sure why I just now stumbled into this but . . . . I learn something new everyday.  :)

You set up a SQL agent job and want to be notified when it fails, so you click on the Notifications option for your job and select the email option.  NotificationsYou have already set up DatabaseMail–that works, you set up your operator and it is enabled and has a 24×7 schedule (Déjà vu perhaps; know someone else with that schedule?).  You are all set and know you will be notified when the job fails.  The next day you check your job–not because you got an email, but you just want to see the green check mark of success and instead you see the red x of rejection with this in the details–
NOTE: Failed to notify ‘DBA’ via email.

Say what??  It appears there is one additional step.  Right click on SQL Server Agent and click properties.  On the Alert system option, click the Enable mail profile and choose the profile you set up for DatabaseMail.  Restart the SQL agent, and voilà you start getting emails.  Well, hopefully not too many.  :)

AlertSystems

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s