开发者

Transaction Replication and Triggers

Say ServerA.TableA is replicated (via Transactional Replication) to ServerB.TableA. If a trigger existed on ServerB.TableA tha开发者_开发技巧t fired when a row was inserted or updated, would the trigger fire as rows are replicated from ServerA.TableA?


It depends on how the trigger was created. CREATE/ALTER TRIGGER statements support the NOT FOR REPLICATION clause:

NOT FOR REPLICATION Indicates that the trigger should not be executed when a replication agent modifies the table that is involved in the trigger. See Controlling Constraints, Identities, and Triggers with NOT FOR REPLICATION.


would the trigger fire as rows are replicated from ServerA.TableA?

Aren't the transactions shipped and applied to the remote server - not rows? This would lead me to think that the transactions are simply applied and the trigger is not actually fired, but the results are applied.

I'm no expert on this - just an idea.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜