April 16, 2012 at 6:20 pm
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.
January 3, 2013 at 5:49 am
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
January 3, 2013 at 5:54 am
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy