dbTalk Databases Forums  

Send e-mail based on the results of a Query

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Send e-mail based on the results of a Query in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Vicente Fuentes
 
Posts: n/a

Default Send e-mail based on the results of a Query - 07-02-2004 , 05:48 AM






I have to send an e-mail based on the results of a SELECT.
i.e.
SELECT something
FROM sometable
WHERE something

The e-mail must contain text based on this result.
How can I do it with DTS.

Thanks.



Reply With Quote
  #2  
Old   
Andy Ball
 
Posts: n/a

Default Re: Send e-mail based on the results of a Query - 07-02-2004 , 06:53 AM






to run in DTS you need to create an Execute SQL task and use the xp_sendmail
Extended Stored Procedure (see Books online for more info)

http://msdn.microsoft.com/library/de...aa-sz_6hbg.asp

Andy.

"Vicente Fuentes" <vicente (AT) tesipro (DOT) com> wrote

Quote:
I have to send an e-mail based on the results of a SELECT.
i.e.
SELECT something
FROM sometable
WHERE something

The e-mail must contain text based on this result.
How can I do it with DTS.

Thanks.





Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Send e-mail based on the results of a Query - 07-02-2004 , 07:04 AM



Have you looked at xp_sendmail?

http://msdn.microsoft.com/library/de...aa-sz_6hbg.asp

Have you also looked at

http://www.sqldev.net/xp/xpsmtp.htm


--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Vicente Fuentes" <vicente (AT) tesipro (DOT) com> wrote

Quote:
I have to send an e-mail based on the results of a SELECT.
i.e.
SELECT something
FROM sometable
WHERE something

The e-mail must contain text based on this result.
How can I do it with DTS.

Thanks.





Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: Send e-mail based on the results of a Query - 07-02-2004 , 08:06 AM



Personally I workaround xp_sendmail, by using xp_smtop_senmail
(http://www.sqldev.net)

Whilst it does not offer @query support natively this can be simulated
through the use of an external export mechanism such as DTS, and then
attaching the file, or us the web assistant stored procedures to produce
an Html file of results which can be used as the message body for an
Html email in xp_smtp_sendmail.


In message <eig2nsCYEHA.3944 (AT) tk2msftngp13 (DOT) phx.gbl>, Andy Ball
<andy.ball (AT) remove4spam_greenfell (DOT) com> writes
Quote:
to run in DTS you need to create an Execute SQL task and use the xp_sendmail
Extended Stored Procedure (see Books online for more info)

http://msdn.microsoft.com/library/de.../en-us/tsqlref
/ts_xp_aa-sz_6hbg.asp

Andy.

"Vicente Fuentes" <vicente (AT) tesipro (DOT) com> wrote in message
news:uZoz5ICYEHA.4008 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
I have to send an e-mail based on the results of a SELECT.
i.e.
SELECT something
FROM sometable
WHERE something

The e-mail must contain text based on this result.
How can I do it with DTS.

Thanks.




--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.