locked
DbSyncProvider with Sql Server 2008 Change Tracking RRS feed

  • Question

  • Hi,

    Is it possible to use DbSyncProvider with a database using Sql Server 2008 change tracking? 

    If the answer to that is yes a sample illustrating Sql Server 2008 Change tracking with the DbSyncProvider would be optimal, alternatively if someone could explain the general strategy that'd be great.

    It seems straight forward what you would do with the SelectIncrementalChangesCommand, InsertCommand, UpdateCommand, DeleteCommand, and SelectRowCommand properties but what would you do with the InsertMetadataCommand, UpdateMetadataCommand and DeleteMetadatacommand properties?

    Basically with the DbSyncProvider I can cope with having to add a couple of peer related tables, but I definitely do not want to create and maintain metadata tables for every table in the database to be synchronised as described here....

    http://msdn.microsoft.com/en-us/library/dd937471%28SQL.105%29.aspx

    It looks as though Sql Server 2008 integrated change tracking is only supported by the SyncAgent/DbServerSyncProvider.

    To give you some background as to why I'm doing this.  I'd like to create a synchronisation process with SQL Server 2008 database with change tracking enabled as the local provider and a custom provider as remote provider. So the synchronisation process goes like this...

    1 SQL DB -> Custom Provider
    2 SQL DB <- Custom Provider

    i.e. I want the changes in the Sql Database synced to the CustomProvider before the custom providers changes are synced to the Sql Database. 

    I would probably have used the SyncAgent and DbServerSyncProvider, however, to use SyncAgent I would need to make my CustomProvider inherit from ClientSyncProvider and my Sql Database provider inherit from DbServerSyncProvider, this would mean that changes would be synced in the reverse order (as I have described above).

    Many thanks in advance...

    Mick Lang
    Thursday, July 9, 2009 8:27 AM