SQL触发器,在插入/更新/删除项目时调用存储过程

时间:2011-08-30 07:31:07

标签: sql triggers

我想使用触发器但是可以使用单个触发器进行插入/更新/删除...我已经完成了删除操作。见下文。

ALTER TRIGGER [dbo].[CleanUpDate]
   ON   [dbo].[Marks]
   FOR DELETE
AS 
BEGIN
        DELETE FROM Grades
        FROM Grades
        JOIN deleted ON Grades.ID = deleted.ID
END

由于

1 个答案:

答案 0 :(得分:1)

是的,请参阅ALTER TRIGGER reference

ALTER TRIGGER [dbo].[CleanUpDate]
   ON   [dbo].[Marks]
   FOR DELETE, UPDATE, INSERT
 AS 
 -- ...