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.
Author |
Topic |
mikebird
Aged Yak Warrior
529 Posts |
Posted - 2008-02-29 : 07:51:10
|
I'm new to the workflow. I'm more used to SSIS. Now I have to use 2000.I need to send the result of a query and send an email at the end.Once I set up the SQL Server connection, I'm not sure where the query goes!? How do I set up an automated email so that a list of recipients is generated by a query against the database?Thanks! |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-02-29 : 07:56:28
|
Use Execute SQL Task to execute query to fetch semicolon separated email addresses of recipients and set output of this query to a global variable which you can use in Send Mail task.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
mikebird
Aged Yak Warrior
529 Posts |
Posted - 2008-02-29 : 12:06:18
|
Sounds really useful.I've been using DTS all day now. How do you get the output of the Execute SQL Task into a global variable and get the Send Mail Task to pick that up? |
 |
|
mikebird
Aged Yak Warrior
529 Posts |
Posted - 2008-03-03 : 05:36:49
|
Setting up a global variable for Execute SQL Task is OK. I think that's a rowset I need. Do I need some VB? I just want to get the results of the query I have running in the first task, and get this sent in the email task - the results, and the list of recipients.I was originally doing this in xp_sendmail and this was a lot simpler, but the boss wants it in DTS now... |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-03 : 05:42:29
|
Export the contents of the query as a CSV or tab-delimited file and send it using Send Mail task as an attachment.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|