locked
Do the DbSyncScopeDescriptions need to be identical for two SyncProviders to be synced? RRS feed

  • Question

  • I have seen many examples where a single DbSyncScopeDescription has been provisioned to both to the server and the client. In my scenario this presents problems because the database schemas are not identical. As an example, I have a CustomerId field on the server which I use in a filter to ensure that each client syncs data for only a single Customer. This field does not exist in the client tables - I store the CustomerId in some database level metadata.

    Applying the DbSyncScopeDescription that I used on the server to the client results in an error because the CustomerId field that I used in the filter does not exist on the client.

    Should I build from scratch one DbSyncScopeDescription for the server and then another for the DbSyncScopeDescription?

    How are fields mapped between the two providers in this case? Do the fieldnames need to be the same for this to work? Are there any other restrictions on two database schemas that should be synchronized?

    Many thanks,

    Scott


    MCSD.Net
    • Moved by Max Wang_1983 Wednesday, April 20, 2011 12:13 AM Forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Sunday, December 6, 2009 1:02 PM

Answers

  • If the column doesn't exist on some clients, before applying, the column can be dropped from the DbSyncScopeDescription first.
    The SyncColumnMapping is for offline scenario which doesn't apply to your situation. Collaboration providers needs same column names on different sides.

    • Marked as answer by Scott Munro Thursday, December 17, 2009 10:32 PM
    Thursday, December 17, 2009 7:53 PM
    Answerer
  • You need to have the filter column on both the 2 peers. However the schemas can be different for other non-filter columns.
    This posting is provided AS IS with no warranties, and confers no rights
    Monday, December 7, 2009 5:22 AM

All replies

  • You need to have the filter column on both the 2 peers. However the schemas can be different for other non-filter columns.
    This posting is provided AS IS with no warranties, and confers no rights
    Monday, December 7, 2009 5:22 AM
  • Thanks Mahesh,

    The documentation is still pretty thin but it looks as though this class would be useful in mapping columns within different names.

    SyncColumnMapping
    http://msdn.microsoft.com/en-us/library/microsoft.synchronization.data.server.synccolumnmapping.aspx

    Can you give any tips on how one might use this class?

    Thanks,

    Scott


    MCSD.Net
    Wednesday, December 16, 2009 8:33 PM
  • If the column doesn't exist on some clients, before applying, the column can be dropped from the DbSyncScopeDescription first.
    The SyncColumnMapping is for offline scenario which doesn't apply to your situation. Collaboration providers needs same column names on different sides.

    • Marked as answer by Scott Munro Thursday, December 17, 2009 10:32 PM
    Thursday, December 17, 2009 7:53 PM
    Answerer