Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 How to in Email SP Results in DTS Pkg

Author  Topic 

kwilliams

194 Posts

Posted - 2004-04-21 : 14:39:48
I have a DTS package that does the following:
1) Runs 3 queries that create 3 new views
2) Runs 3 stored procedures that query the views
3) Drops the 3 views

I want to add an additional step between 2 and 3 in which the pkg will email the results from the 3 stored procedures into one email either as 3 txt attachments, or in the email itself.

So I added a "Send Mail Task" to the package before it drops the 3 views. It does email properly, but I'm not sure of the syntax that's needed to add the results from the 3 SP's to the email itself. How do I go about doing this? Any & all help is appreciated. Thanks.

KWilliams

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-04-21 : 14:43:03
Instead of using the Send Mail Task, use an Execute SQL Task with xp_sendmail. I would put the three stored procedure calls into one stored procedure. Then execute the one stored procedure in xp_sendmail so that it all gets done in one e-mail.

Tara
Go to Top of Page

kwilliams

194 Posts

Posted - 2004-04-21 : 14:47:36
Ok, thanks Tara! I'll see what I can do.
Go to Top of Page
   

- Advertisement -