Need help on Sync framework 2.1 and primary key-foreign key relationship RRS feed

  • Question

  • Does sync framework handles Primary key / foreign key relationship? How to handle if primary key table is not part of synchronization?

    I have read on some blogs Sync Group can be used to handle in such cases. If yes, then can anybody send a example for that.

    Thanks in advance  

    Thursday, February 17, 2011 1:15 PM


  • I will assume that you are using SyncFx 2.1 and the SqlSyncProvider.

    Sync Framework does not transfer the foreign keys by default anyways. It does transfer only the Primary keys.

    So having said that, if your PK table is not in the scope, then you should not have any impact. Since your FK table is all that you are synchronizing, its FK is not transferred to the target database by default (unless you add it explicitly yourself). So a row on the source will need a corresponding row in the PK table. However when you sync this row to the target, it should just get inserted fine because your FK is not even present in the target DB.

    Do I understand your question right though?

    This posting is provided AS IS with no warranties, and confers no rights
    Thursday, February 17, 2011 8:39 PM