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.
精彩评论