SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

AskSQLTeam
Ask SQLTeam Question

USA
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."

JamesT
Yak Posting Veteran

USA
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  
 New 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.06 seconds. Powered By: Snitz Forums 2000