question

colibri avatar image
colibri asked

How do I create a job that emails output to users?

How do I create a job that emails output to users? This is for a nightly status report. Thanks.
jobsdatabase-email
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Wimbush avatar image
David Wimbush answered
You can enable Database Mail and then use msdb.dbo.sp_send_dbmail in a SQL script to send the emails. Execute the SQL script in a SQL Agent job to control when the email goes out.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tim avatar image
Tim answered
What version of SQL Server are you using. Database mail is your best option for SQL 2005/2008. Then there is always Powershell. You could always step it up a notch and use SSRS with a subscription.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.