Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

e-mail job results

Status
Not open for further replies.

mannymo

MIS
Dec 23, 2002
15
0
0
US
I have a job setup that runs sp_spaceused. How can I e-mail the results of the job?
 
Does this job run on a DB level or a Table level?

Thanks

J. Kusch
 
Exec master.dbo.xp_sendmail
@recipients='<email address list>',
@message='Here are the current space used statistics.',
@subject='SQL Server Space Used Report',
@query='Exec sp_spaceused',
@dbuse='YourDatabase',
@width=256,
@attach_results = 'true'

If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
I ended up running the job in two steps, step one runs sp_spaceused on the 12 tables I check and sends the result to a file. Step 2 sends the results file to me (see below).

EXEC xp_sendmail 'e-mail address', @subject = 'space used results', @attachments = 'E:\Program Files\Microsoft SQL Server\MSSQL$SIDESHOW\results.txt'

Thanks,
Manny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top