| Author |
Topic  |
|
|
AskSQLTeam
Ask SQLTeam Question
USA
0 Posts |
Posted - 07/18/2001 : 08:12:54
|
bheema writes "Hello Team Members,
I have a problem while working with a DTS Package, I am creating a automated sending mails package which will completely based on my specified query.
Say my query is as
select taskid,login,email,description,details from xyz;
Here, what i need is that for every login or email the corresponding details are to be pumped to the respective email ids.
I had tried for a long time, what i am able to retreive is that either a first column value or last column value.
If anybody can help me out regarding this. I would be grateful to them.
Thanks in advance.
shankar a.b." |
|
|
JamesT
Yak Posting Veteran
USA
97 Posts |
Posted - 07/18/2001 : 11:48:51
|
The sample code below works for a single e-mail. Put it in a loop with a cursor for multiples:
declare @call_date datetime declare @daterange varchar(75) declare @file varchar(100)
set @call_date = (select stuff from table) set @daterange = 'Values for' + convert(varchar(10),@data_date,101) set @file = '\\server\directory\file'+ '.txt' print @file exec master..xp_sendmail @recipients = @recipientvalue, @subject = 'Something Meaningful', @message = @datarange, @attachments = @file |
 |
|
| |
Topic  |
|
|
|