Pages

Thursday, March 22, 2012

SQL Server 2005 Auto Updated DateTime Column - LastUpdated


CREATE TRIGGER KeepUpdated on Profiles
FOR UPDATE, INSERT AS 
UPDATE dbo.Profiles 
SET LastUpdate = GetDate()
WHERE Username IN (SELECT Username FROM inserted)

No comments:

Post a Comment