编写触发器:
代码如下 | 复制代码 |
create trigger BlogDelet on Blog instead of delete as delete from Comment where CommentBlog in (select Id from deleted) |
创建一个Update触发器:
代码如下 | 复制代码 |
Create Trigger truStudent On Student --在Student表中创建触发器 for Update --为什么事件触发 As --事件触发后所要做的事情 if Update(StudentID) begin Update BorrowRecord end |
更多详细的关于sql触发器可参考http://www.111cn.net/database/mssqlserver/39336.htm
时间: 2025-01-26 14:14:24