发表时间:2006-4-1 0:11:00

CREATE TRIGGER trInsert ON dbo.Products
FOR INSERT
AS

Update
  Products
Set
  LastUpdate = GetDate()
From
  Products p Inner Join Inserted i On p.ProductID = i.ProductID
Where
  p.ProductID = i.ProductID

GO

CREATE TRIGGER trUpdate ON dbo.Products
FOR UPDATE
AS

Update
  Products
Set
  LastUpdate = GetDate()
From
  Products p Inner Join Inserted i On p.ProductID = i.ProductID
Where
  p.ProductID = i.ProductID

GO

posted on 2009-04-29 15:39  袁晓平  阅读(157)  评论(0编辑  收藏  举报