Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send mail to SQL Server and process a query

Status
Not open for further replies.

cbentz

Technical User
Aug 8, 2001
1
US
I would like to send a query via e-mail to a SQL Server that already has SQL Mail functionally. The functionality now used is to send success/fail messages from a DTS package.
What I want to do is:
send a query to change a value in a "control table".
a trigger on that table launchs the DTS package already in place.
I have been digging through BOL for samples, but all I find are examples of SQL sending mail. Can you offer some suggestions:
1. What should the message set to the SQL Server include.
2. What parameters should be used with sp_processmail and
3. What parameters should be used with xp_readmail and xp_sendmail.
 
Hi cbentz,
You just have to execute the following statement :
exec master..xp_sendmail 'myemailid',
@query = 'UPDATE myControlTable SET myCol=myVal'

And there is not need to do anything else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top