SQL Server 2005 Job email notification alerts

  • Hi there, I was wondering if somebody could tell me how to configure the notification alerts on a job properties. Basically I want to receive an email when a job is completed or is failed.

    Thanks

  • In SSMS select Database Mail under Management, right-click and Configure Database Mail. After that's complete send a test mail using the new profile to confirm that works.

    Next, open the properties of the SQL Server Agent. On the Alert System page enable the mail profile. Restart the SQL Server Agent for the change to take effect.

    Under the SQL Server agent create Operators to send messages to.

    Finally, in your job select Notifications and set the Operator to send to when the job completes.

  • Thank you so much it worked!

    Claudia

  • A clarification question. Upon a failed job, I want to send an email to 2 different email addresses. So, I created 2 operators and checked them to receive emails in the Response of the alert properties.

    However, in the Notifications in the Job properties, it only enables you to select one operator to send an email upon the completion of the job. So, I'm confused about how alerts and notifications work.

    It seems that the alerts have all the information it needs to send out the emails, but then if you don't turn on the Notifications, the email is not sent. I tested this by disabling the email in the job under notifications, and left the alert configured to send emails to 2 operators. Upon running the job from this step, and getting a failure, there was no email sent. Am I missing something on how alerts work?

  • I created a distribution list and used that email. As far as I know just one email address.

  • Thanks-

    As a workaround, I added the pager email for the other admin, changed the on-call times to be 24x7, and had it send to the pager for the other admin, since you can't choose 2 email recipients.

    It would be nice if the difference between alerts and notifications were more clear.

  • Maybe you can help me too.. I did all this:

    n SSMS select Database Mail under Management, right-click and Configure Database Mail. After that's complete send a test mail using the new profile to confirm that works.

    Next, open the properties of the SQL Server Agent. On the Alert System page enable the mail profile. Restart the SQL Server Agent for the change to take effect.

    Under the SQL Server agent create Operators to send messages to.

    Finally, in your job select Notifications and set the Operator to send to when the job completes.

    but when I click on sql server agent properties to send a test mail, I can choose my operator but the send test tab is greyed out????

  • Could be wrong, but that Test button in the Agent properties looks to be for SQLMail only. I checked on a SQL 2005 SP2 and SQL 2008 CTP instance; greyed out on both when Database Mail is selected, active with SQLMail.

    You should be able to test Database Mail from its context menu though.

  • Did you use Microsoft Outlook to create the list? Does Outlook have to be installed on the server that your trying to create the notification on? I have tried to do this with no luck...can you explain how you did it?

  • jenelle.hilemon (6/4/2008)


    Did you use Microsoft Outlook to create the list? Does Outlook have to be installed on the server that your trying to create the notification on? I have tried to do this with no luck...can you explain how you did it?

    No, Outlook does not have to be installed on SQL if Database Mail is being used.

    Reference:

    How to create a distribution list (distribution group) in Exchange Server 2003

  • Hi All,

    Does anyone know if it's possible to receive notification of failure AND success rather than one or the other??

    Thanks

    Bob

  • Bob,

    Choose "When the job completes" if you want a notification regardless of whether it succeeds or fails.

  • God I really should have noticed that myself! Thanks a mil 🙂

  • takutoyamada (4/25/2008)


    A clarification question. Upon a failed job, I want to send an email to 2 different email addresses. So, I created 2 operators and checked them to receive emails in the Response of the alert properties.

    However, in the Notifications in the Job properties, it only enables you to select one operator to send an email upon the completion of the job. So, I'm confused about how alerts and notifications work.

    It seems that the alerts have all the information it needs to send out the emails, but then if you don't turn on the Notifications, the email is not sent. I tested this by disabling the email in the job under notifications, and left the alert configured to send emails to 2 operators. Upon running the job from this step, and getting a failure, there was no email sent. Am I missing something on how alerts work?

    I understand, you could send email to two or more people by :

    @recipients=N'rinup@xyz.com';zbc@aby.com,---> delimit semi colan

    🙂

  • @recipients=N'rinup@xyz.com';'zbc@aby.com',---> delimit semi colan

    forgot the quotes;)

Viewing 15 posts - 1 through 15 (of 53 total)

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