Well, follow an example. (Remember, we can do it differently)
First of all, you need to add a new column to the table
Alter table INFORMATION add LastUpdate datetime null
Then you create a trigger (be careful, you must declare the variable Name, as your table)
Create TRIGGER trig_Information ON Information FOR UPDATE AS BEGIN declare @Name as varchar(100) select @Name = i.Name from Inserted i update Information set LastUpdate = getdate() where Name = @Name END
So, every time someone updates any register of this table, the trigger updates the LastUpdate field with the date / time of the operation.
MS. If your table has more than one PC, specify where in the sentence.
see ya
source share