I have this trigger:
This will add today's date in the DATE_UPD field whenever a record is updated. What I wasnt is only for this trigger to run when the field called STATUS is updated. Is this possible?
thanks
ft
Information is not Knowledge, Knowledge is not Wisdom, Wisdom is not Truth, Truth is not Beauty, Beauty is not Love, Love is not Music, Music is the best.
Code:
CREATE TRIGGER updateDateEdit ON dbo.Tester
FOR UPDATE
AS
IF @@ROWCOUNT =0
RETURN
UPDATE Tester SET DATE_UPD = DateAdd(Day, DateDiff(Day, 0, GetDate()), 0)
FROM dbo.Tester Tester
INNER JOIN inserted ON Tester.ID = inserted.ID
This will add today's date in the DATE_UPD field whenever a record is updated. What I wasnt is only for this trigger to run when the field called STATUS is updated. Is this possible?
thanks
ft
Information is not Knowledge, Knowledge is not Wisdom, Wisdom is not Truth, Truth is not Beauty, Beauty is not Love, Love is not Music, Music is the best.