none
Sqlserver Job after the database backup RRS feed

  • Question

  • I have use the Alert, Operator and database mail to send email to server after the database is backed up in sqlserver 2008. I have also used the a stored procedure dbo.sp_SQLNotify following the linkhttp://www.howtogeek.com/howto/database/sending-automated-job-email-notifications-in-sql-server-with-smtp/

    anf http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/ to sen a notification to a email address however I get only one line after the job completion, but I need something like

     


    NEW COMPONENT OUTPUT
    Microsoft(R) Server Maintenance Utility (Unicode) Version 9.0.3080
    Report was generated on "server".
    Maintenance Plan: Differentialbackup
    Duration: 00:00:06
    Status: Succeeded.
    Details:
    Back Up Database (Differential) (server)
    Backup Database on Local server connection
    Databases: Lists database names
    Type: Differential
    Append existing
    Task start: 2011-10-11T10:00:03.
    Task end: 2011-10-11T10:00:09.
    Success

    Maintenance Cleanup Task (server)
    Maintenance Cleanup on Local server connection
    Cleanup Database Backup files
    Age: Older than 1 Weeks
    Task start: 2011-10-11T10:00:09.
    Task end: 2011-10-11T10:00:09.
    Success


    • Edited by ChitraSaha Tuesday, October 11, 2011 8:09 PM
    Tuesday, October 11, 2011 7:44 PM

Answers

  • If you want detail report like this; output all your results of the Mainteance Plan/Jobs to Log file.  And in your email alert attach that log file @file_attachments parameter in sp_send_dbmail.
    Mohit K. Gupta --- MCTS, MCITP, MCC2011 http://www.opsvault.com http://sqllearnings.blogspot.com/
    • Marked as answer by Stephanie Lv Tuesday, October 18, 2011 9:29 AM
    Tuesday, October 11, 2011 10:15 PM
  • hi

    On every job step property you have an advanced option . on that specify a log file in Output File textbox. Add another step to your sql job to email the logfile 

     

    Hope this help...

     

    VT 


    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker
    • Marked as answer by Stephanie Lv Tuesday, October 18, 2011 9:29 AM
    Wednesday, October 12, 2011 1:39 PM

All replies

  • If you want detail report like this; output all your results of the Mainteance Plan/Jobs to Log file.  And in your email alert attach that log file @file_attachments parameter in sp_send_dbmail.
    Mohit K. Gupta --- MCTS, MCITP, MCC2011 http://www.opsvault.com http://sqllearnings.blogspot.com/
    • Marked as answer by Stephanie Lv Tuesday, October 18, 2011 9:29 AM
    Tuesday, October 11, 2011 10:15 PM
  • Thanks for the great information, however how do I output the result to the job logfile and then to sp_send_dbmail.
    Wednesday, October 12, 2011 1:12 PM
  • hi

    On every job step property you have an advanced option . on that specify a log file in Output File textbox. Add another step to your sql job to email the logfile 

     

    Hope this help...

     

    VT 


    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker
    • Marked as answer by Stephanie Lv Tuesday, October 18, 2011 9:29 AM
    Wednesday, October 12, 2011 1:39 PM