emailling the log, not just the event?

  • Hi there,

    This may appear a noddy question to some, so apologies in advance.

    I would like to know how to receive the output of a job that's been run, not just an email notification that it has run.

    Basically I'm running EXEC master..xp_fixeddrives as a scheduled job and would like the output of said command with the email I receive.

    Thanks in advance

  • depends how you're handling the email. putting the data into a temp table and placing the results via xp_sendmail is one method.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • master.dbo.xp_sendmail @recipients='email@xyz.com',@query ='EXEC master..xp_fixeddrives'

  • you can store the output of the jobs as nad when run to a text file. then use the @attachments parameter so attach the file in your mail msg.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply