I'm writting a trigger for update event, and I want to compare the old data with the new data before doing something.
The table has two columns.
CulumnA (nvarchar 20)
and the trigger:
CREATE TRIGGER MyTableUpdate ON My_Table_Name
Declare @oldColumnA as nvarchar(20)
Declare @newColumnA as nvarchar(20)
Declare @oldColumnB as int
Declare @newColumnB as int
Set @newColumnA= /* new value */
Set @oldColumnA = /* old value */
/// Compare them and do something.
How can I get the old data and new data in my trigger?