Sql-server – Replication : Which subscription changed a row

replicationsql server

Is it possible to query the replication metadata to see which subscription caused a change to a specific row in a table?

Best Answer

If the change hasn't yet been replicated you can look in the distribution database to see which publication will change the value.

If the subscriber is in full or bulk_logged recovery you can look in the transaction log to see what user made the change (it might have the application name in there, if it does that'll tell you what SQL Agent job made the change and therefor which publication and subscription made the change). If you are in simple recovery mode you are hosed unless you are logging this data yourself somewhere within the subscriber.