views:

31

answers:

2

Say ServerA.TableA is replicated (via Transactional Replication) to ServerB.TableA. If a trigger existed on ServerB.TableA that fired when a row was inserted or updated, would the trigger fire as rows are replicated from ServerA.TableA?

A: 

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.

Sam
+3  A: 

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.

Remus Rusanu