Asked by:
Tables Order on scope, works for Inserts but not fot deletes

Question
-
Lets say I have 2 table and a relationship, table A parent, table B child with FK to A.
When I add the tables to the scope I add first A then B, because if I try to Insert a B, will make a reference to an A that doesn't exist. So that works fine, but, if the Sync Fx has to make a delete on that syncronization, it will try to delete an A that is used on B so it won't do it. Do I have to configure SQL Server to do cascade delete? Does Synx Fx has an option for this?
Thx in advance
Ramiro
Thursday, December 16, 2010 4:05 AM
All replies
-
Hi Ramiro,
Deletes should be applied in reverse order. So in your example, B should be deleted before A. Are you observing some other behavior in your case?
SDE, Sync Framework - http://www.giyer.comThursday, December 16, 2010 5:27 PM -
Sure, so in order to make this work, to make all the inserts and deletes, I have to sync twice the same tables but in different order, right? Doesn't sound like should be already solved?Thursday, December 16, 2010 11:16 PM
-
When you add A (parent) and then B (child) when provisioning, sync framework will be smart enough to do insert/update in A then B order and delete in B then A order. So you should not encounter problems with this relationship.
- Proposed as answer by jigu2014Microsoft employee, Editor Tuesday, December 21, 2010 12:25 AM
- Unproposed as answer by Ramiro R Friday, December 24, 2010 10:40 PM
Tuesday, December 21, 2010 12:25 AMAnswerer -
Not my case, I thnk Sync Framework is not smart enough... at least using it with templates... I had to set Cascade on Delete...Friday, December 24, 2010 10:41 PM
-
Which sync framework provider and version are you using?Monday, December 27, 2010 7:27 PMAnswerer