question

baggyrick avatar image
baggyrick asked

Replication - mutliple publishers to single subscriber table with adding extra column

Is it possible to have the changes from tables in four separate databases with transactional replication merged into 1 single subscriber database and table. I would be needing to add a column in the subscriber table which identifies the database of the published table data, but I can't see where this is possible in published articles or subscriptions.

replication
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
anthony.green avatar image
anthony.green answered

You could with a trigger.

Replicate all 4 tables to 4 individual tables, then have a trigger on each which is for after insert/update to push the changes to the combined table. with another column to say the source and the unique identifier as the PK


TX replication relies on a unique identifier for the row, so if you have ID 1 in all 4 publishers, then you only going to have 1 row, not 4 as it will violate the PK, unique identifier.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.