SQL Server triggers not firing with replication

Ran into a problem today. Two SQL DBs, using transactional replication. I had some triggers created on the subscriber end that worked off insert, delete, and update operations.

The triggers worked great when inserting/updating/deleting data locally on the subscriber DB. But when a table was modified via replication, no triggers fired.

I thought replication just treated updates as a series of deletes and inserts, but the delete and insert triggers weren't firing, either.

If you're having a similar problem, first make sure your triggers don't have a "not for replication" setting. Sadly, mine don't. That's sad because a solution took a very long time to find.

The solution was a rather cryptic setting that tells replication to send updates *as* updates, rather than a delete/insert.

DBCC TRACEON (8207, -1)

Read about the details and caveats here. I don't think this is the best solution, but nothing seemed to work, and nobody seems to know why this would occur.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)

Psykel blog uses BlogCFC (by Raymond Camden). Layout design inspired by arcsin