Use Sync Framework only for Uploads to the central server database RRS feed

  • Question

  • Need help 

    I would like to use Sync Framework only for Uploads to the central server database .
    1.I have provisioned the master database with one scope and one table(TableA)
    2.Created a copy of the master database using SMO methods.
    3.Populated records in the Sync table(TableA) using sqlbulk insets with complex query for the filtering .
    4.Provision the local database with the scope that created in step 1.

    When I sync the local DB with the master using Upload option it's show that is uploaded x records, but when I query the central database the records not there.
    However when I use the filtered scope option and download the records via sysnc process, and then create a new records in the provisioning table(TableA) and uploading back to the server works fine.
    I would like to using the sync Framework for Uploads only .

    Populating the client table with data using my custom method because the schema very complicated and I need to write a complex query in order to get a filtered subset of data for the scope table(TableA).
    I have to repeat this steps many time for all client databases (300).

    Could you please advice how to achieve this using Sync Framework  and why when I am uploading the records looks like they are uploaded  but in fact they are not.

    Thank you in advance 


    Wednesday, February 6, 2013 2:40 PM

All replies

  • just a couple of clarifications, what was step # 2 for?  where do you use this copy?

    for #3, sync framework uses triggers to keep track of changes, bulk inserts don't fire triggers by default.

    Thursday, February 7, 2013 1:04 AM
  • I am creating a copy from the master and this copy will used for the client database with out sync object . Step 3 I am inserting the data to the table, only after that I am provisioning this database from the previous created scope. Inserting a new record using insert statement not bulk insert and then upload to the central db. I can send you screen short and log file Thank you so much. Leon


    Thursday, February 7, 2013 1:59 AM
  • if you're restoring a backup to the client, then you dont need to provision a scope, the database has a scope already that you can re-use.

    when you restore a database, make sure you run PerformPostRestoreFixup on it before you sync it and that should be good to go.

    I would suggest you subscribe to ApplyChangesFailed event as well so you know if there was an error applying changes or if there was a conflict.

    Thursday, February 7, 2013 2:08 AM
  • JuneT the database client database that I am creating do not have a scope it is just schema with data for the lookup tables. In order to upload the changes from one single Table I need to prepare the client using the scope that has been created in the master otherwise I cannot use upload/download so on. Thanks again


    Thursday, February 7, 2013 2:27 AM
  • check the ApplyChangeFailed event if gets fired when you do an upload. 
    Thursday, February 7, 2013 5:47 AM
  • Thank  you June I will take a look and let you know if it's works.


    Friday, February 8, 2013 6:39 PM