主题:求教触发器问题
chetah
[专家分:0] 发布于 2006-05-12 22:17:00
可不可以因为一个表的更新而触发另一个表的更新?还是只能都在同一个表里触发
回复列表 (共1个回复)
沙发
a97191 [专家分:4040] 发布于 2006-05-13 10:31:00
都可以,例子
USE Northwind
CREATE TRIGGER Category_Delete
ON Categories
FOR DELETE
AS
UPDATE P SET Discontinued = 1
FROM Products AS P INNER JOIN deleted AS d
ON P.CategoryID = d.CategoryID
我来回复