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

Trigger to send email

Status
Not open for further replies.

jazgeek

IS-IT--Management
Jan 29, 2004
541
I've written a few triggers before (mostly with help from this forum) but I'm lost on how to do this one

I have a table SalesOrders

in this table is a field called DueDate.

What I'd like to do is fire off an email using xp_sendmail to a recipient whenever this date is updated.

However, the application that updates this table updates the record several times depending on how many records exist in a table called SalesOrderDetails (linked via a primary key called salesorderid. Ie, if there are 4 records in SalesOrderdetails, SalesOrder updates 5 times.. once for itself, and 4 times for each successive SalesOrderDetails.

How do I compose a trigger that will only fire an email off once?

-----------
and they wonder why they call it Great Pains!

jaz
 
do it via the application dude, thats my suggestion...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top