Ad

How To Add A Constant Column When Replicating A Database?

- 1 answer

I am using SQL Server 2000 and I have two databases that both replicate (transactional push subscription) to a single database. I need to know which database the records came from.

So I want to add a fixed column specified in the publication to my table so I can tell which database the row originated from.

How do I go about doing this?

I would like to avoid altering the main databases mostly due to the fact there are many tables I would need to do this to. I was hoping for some built in feature of replication that would do this for me some where. Other than that I would go with the view idea.

Ad

Answer

So the solution for me was to set up the replication publications to allow transformations and create a DTS package for each site that appends the siteid into the tables to keep the ids unique as I can't use guids.

Ad
source: stackoverflow.com
Ad