Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Database Mail Notification Expand / Collapse
Posted Monday, April 16, 2012 6:20 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 24, 2012 3:16 PM
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.
Post #1284614
Posted Thursday, January 3, 2013 5:49 AM


Group: General Forum Members
Last Login: Tuesday, April 16, 2013 8:34 AM
Points: 23, 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
Post #1402313
Posted Thursday, January 3, 2013 5:54 AM



Group: General Forum Members
Last Login: Thursday, September 1, 2016 2:56 AM
Points: 5,969, Visits: 6,067
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.


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

Post #1402314
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse