locked
How to reprovision Sql Compact database, after schema update RRS feed

  • Question

  • Hello

    How can you modify a scope definition after a schema update (add|remove columns)?

    I do not want to deprovision  and provision again, I just want to include the new column in the synchronization scope.

    SqlSyncScopeProvisioning has a Script method, but no alternatives exist for SqlCeSyncScopeProvisioning.

    Angela


    sb_angela
    Wednesday, October 19, 2011 8:03 AM

All replies

  • try modifying the config_data column in the scope_config table
    Wednesday, October 19, 2011 12:38 PM
  • Hello

    This is something that I have tried and works ok. I am curious if there is another [better] way, using the MS Sync API.


    sb_angela
    Thursday, October 20, 2011 6:29 AM
  • sync framework ootb doesnt support schema changes and as you find out, there is no script() method for the sql ce provider to generate the provisioning script. sql ce sync provider uses sql ce change tracking instead of the custom tracking used by the sql sync provider.
    Thursday, October 20, 2011 8:29 AM
  • Ok, so the only solution is to modify the information inside the scope_config table. Is there a way to obtain that information automatically? Does the Sync API allows to connect to Sql Ce database and read the config_data information?

     



    sb_angela
    Thursday, October 20, 2011 10:27 AM
  • unfortunately, there's none as well.

    Steve (Speedware) has posted how he retrieves the scope_config data in here: http://social.msdn.microsoft.com/Forums/en-US/syncdevdiscussions/thread/4af321b6-4678-4620-af46-98c560cc2bc6

    he connects directly to the database, read the column and cast it back to the scope configuration object.

    you can use this as a starting point and then write back the config data when you're done manipulating it.

     

    Thursday, October 20, 2011 1:44 PM