Click here to Skip to main content
15,886,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have 3 dump files from 3 different machines pc1, pc2 and pc3. I am trying to sync the data from the 3 dump files with the database on my server but, unfortunately the dump files have similar unique ids for different records, because they are on different machines. When merging, the data from the dump file, overwrites the data on my server(if they have the same unique id). Is there a way for creating new records for the records that has the same unique id but different data fields. If no if there are other 3rd party tools for that?

What I have tried:

I have found a similar question but it gave one of 2 solutions:

    1. Either to replace the repeated rows

    2. Or to skip the repeated records

And no one of the above is suitable for me. I need to create a new record for the repeated rows with repeated unique ids but different other data field values
</pre>
Posted
Comments
Richard MacCutchan 13-Apr-18 7:11am    
Create a new unique id for each record as you read them in.
Ahmed AE 13-Apr-18 10:29am    
What if there are the same record in 2 dump files but have different id's.
Richard MacCutchan 13-Apr-18 10:36am    
Well you will have to find some method of identifying them and excluding the duplicate. It sounds like you first need to merge the three dumpfiles and discard any duplicate records. You can then process the remainder, changing the id of each record to a new unique id that does not conflict with your existing data.
Ahmed AE 13-Apr-18 11:32am    
the problem that is found between the dump files and each other, can also be found between the resultant dump file (after merging) and the database on my server,i mean that there might be records that are found in the resultant dump file and also found in the database on my server, so what can i do in that case?
Richard MacCutchan 13-Apr-18 11:51am    
Then follow the above suggestion.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900