Reputation: 97
I am using Microsoft Sync Framework, so the issue is I have 2 tables with the same structure and I realize that I have sometimes the same data with different PK, and new data with and existing PK. How could I merge both tables, this scenario is BIDIRECTIONAL. None of the data could be lost.
Example:
BIDIRECTIONAL SYNC SCENARIO where shouldnt be lost of data
Server1 PK id
People ----------------------------------------------------
id name
1 John <--- here the id is 1 and so on
2 Carl
3 Catherine
4 James
5 NewGirl
Server2 PK id
People -----------------------------------------------------------------
id name
1 Carl <--- here the id is 1 but in the other table is JHON and so on
2 John
3 MAO
4 Louis
5 NewBoy
I would be happy to have at least an answer for first part
SECOND PART: ***But to make things worse there is another table relating addresses
Server 1 People_Addresses -------------------------------------------
id id_people Address
1 1 Address1 ----> Jhon has more than one address
2 1 Address2
3 2 Address3
4 2 Address1
.....
Server 2 People_Addresses ---------------------------------------------------------
id id_people Address
1 1 NewAddress3 ----> Carl has just a new address
2 2 NewAddress3 ----> Jhon has just a new address
......
Thanks in advance
Upvotes: 0
Views: 97
Reputation: 7860
unless you change your PK to globally uniquely identify your rows, there's no way around it. Sync FX uses your PK to uniquely identify your rows so it nows which record to apply an update on the destination.
even without using Sync Fx, you'll still end up with same issue.
Upvotes: 1