SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Setting Notification email (When the job fails)


Setting Notification email (When the job fails)

Author
Message
Aspet Golestanian Namagerdi
Aspet Golestanian Namagerdi
Old Hand
Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)

Group: General Forum Members
Points: 372 Visits: 836
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
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5166 Visits: 4076
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;-)
Aspet Golestanian Namagerdi
Aspet Golestanian Namagerdi
Old Hand
Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)

Group: General Forum Members
Points: 372 Visits: 836
No,When I set the job I added notification through GUI(when the job failed,send an email to DBA GROUP).
anthony.green
anthony.green
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10031 Visits: 6303
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.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


Aspet Golestanian Namagerdi
Aspet Golestanian Namagerdi
Old Hand
Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)Old Hand (372 reputation)

Group: General Forum Members
Points: 372 Visits: 836
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.
anthony.green
anthony.green
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10031 Visits: 6303
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.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


simmonssql
simmonssql
Valued Member
Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)

Group: General Forum Members
Points: 54 Visits: 279
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search