x

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.
more ▼

asked Sep 20 '11 at 08:54 AM in Default

colibri gravatar image

colibri
151 15 15 15

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first
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.
more ▼

answered Sep 20 '11 at 09:00 AM

David Wimbush gravatar image

David Wimbush
4.7k 28 29 31

(comments are locked)
10|1200 characters needed characters left
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.
more ▼

answered Sep 20 '11 at 09:08 AM

Tim gravatar image

Tim
35.5k 32 41 138

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x19
x18

asked: Sep 20 '11 at 08:54 AM

Seen: 842 times

Last Updated: Sep 20 '11 at 08:54 AM