EntLibQuickStarts数据库Products表里的两个触发器

发表时间: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

你可能感兴趣的:(start)