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


Database Mail Notification


Database Mail Notification

Author
Message
sairam6819
sairam6819
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 36
Hello ,
Can you suggest me how to Receive a mail notification, not as soon as job completes but at a particular time after the job completion. In the job setup window, I just have an option in notifications as ' when job succeeds'. I want to get notified in the morning after job succeeds (job runs at night). May be I was thinking that I can use jobhistory tables (job_status column) and write a script such that if status is success, notify operator at particular time. Any suggestions would be appreciated.
peterdru401
peterdru401
SSC Rookie
SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)

Group: General Forum Members
Points: 45 Visits: 128
You can set some alert through an utility like after the successful completion of job you will receive a mail
Use some monitoring software like this

http://www.windowseventlogmonitor.com/
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: 10302 Visits: 6378
Add a step into the job which uses WAITFOR TIME command to delay the sending of the mail. Then execute a msdb.dbo.sp_send_dbmail command with the mail you want to send.

I would do two, one for success one for failure, then set the main job step to go to the right mail step depending on its outcome.

So

Step1 - Run my procedure, on success go to step2, on failure go to step3
Step2 - WAITFOR TIME '07:30' send success mail, on success quit reporting success, on failure quit reporting failure
Step3 - WAITFOR TIME '07:30' send failure email, on success quit reporting failure, on failure quit reporting failure



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


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