Setting Notification email (When the job fails)

  • Hi Everyone,

    I have setup a job(SQLS ERVER 2008 R2) in two servers Server1.Domain1 & Server1.Domain2 and I have enabled notification email when the job

    fails.But when we recieve the notification(in case of job failure) email,on the subject of email it says "Subject: SQL Server Job System: Job1

    completed on \\Server1".

    Subject does not show ,if this has happened on Server1.Domain1 or Server1.Domain2?Is there anyway that we can add domain name on notification

    email.

    Thanks

  • Aspet Golestanian Namagerdi (11/19/2012)


    I have enabled notification email when the job

    are you using database mail ?

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • No,When I set the job I added notification through GUI(when the job failed,send an email to DBA GROUP).

  • On the notifications area of the job, you have set it to email a operator if the job fails, correct?

    If so you will need to ensure that you have enabled and configured database mail.

    Ensured that the SQL server is allows to relay mail.

    Ensured that you have stopped any anti-virus / spyware programs from blocking mass mail worms.

    Ensure you have set the Alert System of the SQL Agent properties access to Database Mail and the profile you have created.

    Once all donw restart the SQL Agent service to pick up the new configuration.

    After which is the job will fail it will send the alert.

  • I recieve the alert email,but on subject of email it does not show the Full name of server.I mean it just shows Failure on Server1.The problem is, we have multiple Server1 in different domains and we need to have the full server on alert email subject.

  • Your into the inner workings now of how SQL Agent passes the subject from the Agent alert system to sp_notify_operator. My best bet would be for you to create your own email step within the job to send an email when a step fails by using the on failure actions of the other steps, and passing in the FQDN using powershell as you cant get the FQDN from SQL itself, you need to get it from the Windows host.

  • You can specify a display name in the Outgoing mail server (SMTP) settings of the Database Mail account. Make these unique on both instances and you should be able to differentiate between the two when they arrive in your inbox.

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

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