Mark Freeman
Mark Freeman

Reputation: 1155

Will an INSTEAD OF trigger always fire before an AFTER trigger on the same table in SQL Server?

If I have an INSTEAD OF UPDATE trigger and an AFTER UPDATE trigger on the same table in SQL Server, is the execution order of those guaranteed to be INSTEAD OF first and then AFTER?

If so, will the inserted table in the AFTER trigger always see the result of the INSTEAD OF trigger?

My specific use case is that the INSTEAD OF UPDATE trigger is updating what is the functional equivalent of a computed column and the AFTER UPDATE trigger has logic that is using that computed column.

Upvotes: 1

Views: 1283

Answers (1)

HLGEM
HLGEM

Reputation: 96552

From Books online:

AFTER triggers fire after the triggering action (INSERT, UPDATE, or DELETE), INSTEAD OF triggers and constraints are processed.

Upvotes: 1

Related Questions