View Single Post
  #4 (permalink)  
Old January 23rd, 2006, 05:58 PM
David_the_DBA David_the_DBA is offline
Friend of Wrox
 
Join Date: Dec 2005
Location: , AZ, .
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Default

--IF you want to accomodate updates then
CREATE TRIGGER trg_myTable_ModDate
  ON myTable
 AFTER INSERT, UPDATE
AS

UPDATE myTable set ModDate = GETDATE()
FROM myTable
JOIN inserted i
ON i.ID = myTable.ID -- where ID is your primary key



David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com
Reply With Quote