I looked at some previous answers to triggers here, but cannot find what I need, but I'm sure my question has been asked / answered earlier.
I am trying to track any changes in column A and column B in a table.
If this value changes, I want to track the values by inserting the existing value and the new value into another table with the date.
I was looking for using something similar for insertion, but not sure how to add get existing and new values of the original table (table1):
CREATE TRIGGER NewTrigger ON table1 FOR INSERT AS INSERT INTO table2 (columnA , columnB, todaysDate) . . go
I need to use (I think)
Before update ON table1 FOR EACH ROW . . . BEGIN
and review all the changes and insert them first, then do the same after the update?
sql sql-server sql-server-2008 triggers
Standage
source share