SQL 触发器:它们是在语句或事务之后触发的吗?
我正在寻找一个答案:SQL 中的触发器是在语句引起的操作之后立即触发,还是仅在整个事务提交后触发?
I'm looking for an answer to whether triggers in SQL are fired immediately following an action caused by a statement, or only after the entire transaction is committed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 SQL Server 中,
AFTER
触发器在语句引发的操作之后立即触发。 (事务可以通过触发器回滚)。还有
INSTEAD OF
触发器可以代替触发操作触发。DML 触发器
CREATE TRIGGER
另外感兴趣的是:Joe Celko 的 触发器:威胁还是威胁?
In SQL Server,
AFTER
triggers are fired immediately following an action caused by a statement. (A transaction can be rolled back by a trigger).There are also
INSTEAD OF
triggers which fire in place of the triggering action.DML Triggers
CREATE TRIGGER
Also of interest: Joe Celko's Triggers: Threat or Menace?