mentor360
asked on
How to resolve primary Key changes with Sync Framework 2.1
Hi,
I am synchronizing 2 databases in a one direction enviroment using Sync Framework 2.1. That means i have a "master" database and a "slave" db and i want the changes made in the master db to be downloaded to the slave db. I am only using 2 tables.
It works ok except one case. If i change the primary key in a row in the master db, this change is not reflected in the slave.
Does anybody have a clue or does anybody knows how to make the Sync FW works in those cases?
Thank you.
I am synchronizing 2 databases in a one direction enviroment using Sync Framework 2.1. That means i have a "master" database and a "slave" db and i want the changes made in the master db to be downloaded to the slave db. I am only using 2 tables.
It works ok except one case. If i change the primary key in a row in the master db, this change is not reflected in the slave.
Does anybody have a clue or does anybody knows how to make the Sync FW works in those cases?
Thank you.
ASKER
I have a restriction and i can't create triggers appart from the ones created by the sync framework provisioning. I thought maybe the sync framework could be configured to track the PK changes too.
How would it match to the row to change the PK? If you have other columns that act as additional unique (natural) keys, then you may be able to JOIN on those update PK ...
ASKER
I guess Sync Framework works different because it's able to detect and apply a DELETE. i just tested and manually deleting and inserting the row worked. But I would highly prefer the framework to work with the updates.
The framework should work for updates, just not against the primary key. Sorry.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The was no solution I had to change my environment
@mentor360: so to be clear for future readers - sync'ing primary key changes will not work, so your workaround is to make the column you needed to be able to change NOT a primary key. Anyway, glad you got this sorted.
Best regards and happy coding,
Kevin
Best regards and happy coding,
Kevin
The issue with UPDATE is it will come over to the slave and try to match on the PK to do update. Since the PK is now changed, you won't make any connections.
Kevin