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
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