Hi Andrew,
Here is a quick example
In the trigger declare old and new values
DECLARE @oldvalue int,@newvalue int
SELECT @oldvalue = (SELECT columnname from deleted)
SELECT @newvalue = (SELECT columnname from inserted)
Now use the @oldvalue and @newvalue in your calculations
HTH
John
>Does anyone know if it's easy to reference both old and new field values via triggers in SQL Server 7.0. e.g. If I was amending a balance detail record and changing the ordered quantity from 10 to 20, I would would want to update the ordered quantity on the balance header record by the (current header value + (new detail value - old detail value)) hence I would need to know what the new and old balance detail ordered quantities were. Thanks.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only