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
 SQL Server 2008 Forums
 Replication (2008)
 Need help:- Is it possible to merge two databases.

Author  Topic 

rs.alltime
Starting Member

2 Posts

Posted - 2011-11-24 : 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.

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2011-11-24 : 07:50:25
unless you change the architecture there is nothing to stop this happening again in the future......

If two sites need to enter data locally (rather than referring to a central truth store) then you really can't let them specify keys. You'll need some mechanism to guarantee a particular patient is unique. This is difficult!

Maybe tell us more about the architecture?

Is it just that the details of the patient are different but they are guaranteed to be *the same person*

or are these two different people with the same reference key?

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-11-24 : 08:21:34
>> 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.

Nope - you will need a backup taken before the date wanted and transaction logs up to that date to do a point in time restore.
Another option is (if you have audit tables) to roll back changes.

Do you have a plan to correct the issue? Will probably need some redesign and this would be a good time to do that.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -