Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need help:- Is it possible to merge two databases.

Author  Topic 

rs.alltime
Starting Member

2 Posts

Posted - 2011-11-24 : 02:40:49

Posted - 11/24/2011 : 01:51:19
Hi ,

I have encountered a critical scenario where in client has same application installed in 2 servers with 2 different database and an interface to connect to both.

Now what has happened is they have manually entered some data in 2nd application which has the same MRN number as the one in 1st application(however the details of patient is different in both).So when there is any data updated from the first application , through the interface the same was sent to 2nd application.However when the MRN of 1st application is already present in second application then it has overwritten the data.

For example :- SAM with MRN as 1 in 1st application has updated his phone number which is sent to 2nd application via the interface, Where Lin has MRN as 1.So Lin is being replaced with details of SAM.

Now we have stopped the interface , however the clicnt needs all the data which was present in 2nd database before a certain date i.e before go live.

So I am planning to take a back up of present and then planning to do a database restore to a particular date, then merge the both of them.



I am kind of new with this issue so need your suggestions on this.

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-11-24 : 04:07:49
You will need to know all referenced tables and their structures. You will then need to write a script to MANUALLY change all the identifiers on this data to be unique on the still running copy. If they are idenitities, you will need to look up the IDENTITY_INSERT setting. You will also need to make sure all the reference data identifiers are the same.

Depending on the complexity of your system, this could either be a fairly simple job or your worst nightmare. Good luck.
Go to Top of Page
   

- Advertisement -