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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending results via email

Status
Not open for further replies.

DiggerDog

Programmer
Nov 24, 2002
60
AU
Hi

Is there a way to put the results of a stored procedure into an xls file and mail the file to the appropriate people via e-mail.

I've been trying to do this using DTS packages but can't seem to get it to work. I can execute the SP and then send an email notification saying it has completed but I am unable to send the results out with the notification.

Any help greatly appreciated
 
Yes, I have several packages set up to do just this. Basic steps:

1) Add a SQL Server connection
2) Add an Excel connection
3) Set up a transform data task between the two
4) Add a Send Mail task and specify the Excel file in the attachments

You will also need to add a couple of steps at the start to drop and recreate the Excel sheet.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top