May 16, 2008 at 8:54 am
I have two databases that I need to merge. One is parent and other child. The issue I have is I have the same primary key on both databases but the keys pertain to two totally different records. How I merge the two databases (move parent data into child) and keep all the info from both databases? When moving the data from parent into child I want to keep the primary keys from parent as is but change the primary key on the child if it already exists and perform a cascading update on all the tables that use this key that is being changed. Can this be done and if so how?
May 16, 2008 at 1:01 pm
This can be done, but it's tricky. I would stage the parent data in its own table first, and then do a join to update the child table. As far as using repl for this process, yeah it can be done. Just take whatever logic you work out for doing the update and use a custom sp for the repl.
Like I said, it's tricky, but doable.
Watch my free SQL Server Tutorials at:
http://MidnightDBA.com
Blog Author of:
DBA Rant – http://www.MidnightDBA.com/DBARant
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply