THE SQL Server Blog Spot on the Web

Welcome to - 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: 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



Zarnaya said:


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


This Blog


Privacy Statement