THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Tibor Karaszi

Send email after Agent job execution

After executing a job, I want to have an email with the following information:

  • Success or failure in the mail subject (not just in the body)
  • Success or failure and execution time for each job step in mail body
  • Have output file(s) for the job steps attached to email

Agent has none of above built-in so I created my own procedure for this. This is meant to be added as a final job step for your jobs. You find all details and the procedure here: http://www.karaszi.com/SQLServer/util_MailAfterJob.asp. Feedback is of course very welcome.

Published Wednesday, December 28, 2011 1:15 PM by TiborKaraszi
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Zarnaya said:

Hello!

What if there is several .rpt files that are generating during some job steps? How can I attach them to e-mail?

December 28, 2011 8:31 AM
 

TiborKaraszi said:

This is only to include the ouput file, of which you can have max 1 per jobstep. You will have to adapt the code if you have something else that generates files that you want to attach.

December 28, 2011 8:45 AM

Leave a Comment

(required) 
(required) 
Submit

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement