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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Automated emails using DTS in SQL Server 2000
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ask SQLTeam Question

0 Posts

Posted - 07/18/2001 :  08:12:54  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
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."

Yak Posting Veteran

97 Posts

Posted - 07/18/2001 :  11:48:51  Show Profile  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000