且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

FOR和AFTER触发器之间的区别?

更新时间:2023-02-04 21:56:27

没有区别,它们做的是相同的事情。

There is no difference, they do the same thing.

CREATE TRIGGER trgTable on dbo.Table FOR INSERT,UPDATE,DELETE

CREATE TRIGGER trgTable on dbo.Table AFTER INSERT,UPDATE,DELETE

INSTEAD OF 触发器是不同的,它在插入之前和之前触发,并且可以在视图上使用,以便将适当的值插入基础表中。

An INSTEAD OF trigger is different, and fires before and instead of the insert and can be used on views, in order to insert the appropriate values into the underlying tables.