February 16, 2006 at 11:59 am
Hi folks,
I want to run a DTS package, in the package, I run a query which will return me some data, I want to use the data as an attachment in the SQL mail and send back to me.
Is that possible? if yes, how to do that?
Thanks.
February 16, 2006 at 12:42 pm
February 16, 2006 at 2:39 pm
transform the data from the query to a file and then use that file as an attachment to send the mail...
-Krishnan
February 17, 2006 at 8:41 am
I don't know if this will help, but you could setup a job that sends you an email using xp_sendmail that has the query in the send mail script.
Schedule your DTS and create a second step with a script like the example below I got from BOL to email the results of the query to you as an attachment.
EXEC xp_sendmail @recipients = 'robertk', @query = 'SELECT * FROM INFORMATION_SCHEMA.TABLES', @subject = 'SQL Server Report', @message = 'The contents of INFORMATION_SCHEMA.TABLES:', @attach_results = 'TRUE', @width = 250
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply