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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

outlook subject value

Status
Not open for further replies.

LloydDobler

Technical User
Oct 3, 2002
192
CA
Hoping someone can help with this one. I'm trying to automatically send an e-mail to an account where the subject equals a newly inserted filed record entered into the database. The e-mail is sent no problem, I just don't know how to include the new record in the e-mail or the subject. Is this possible? If so, how? Thanks for any help.
 
okay, what i'm trying to do is send an e-mail after a new record is inserted. Our example is that when a new record is inserted, the 'NCRnumber' should be included in the subject or body of the e-mail. I read a previous post saying a query needs to be run but I receive an error saying "xp_sendmail sendmail expects parameter @query, which was not supplied"

CREATE TRIGGER tr_newNCR
ON NCRtest
FOR INSERT
AS
declare @c1 varchar(500)
set @c1 = 'Select inserted from NCRtest..NCRNumber
WHERE NCRNumber = '''+@c1+ ''''

EXEC master..xp_sendmail 'QTY',
@subject = 'NEW NCR',
@message = 'A New NCR has been created',
@query = @c1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top