Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8866297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:45:18+00:00 2026-06-14T16:45:18+00:00

I have an application that syncs between 2 database: the central one is hosted

  • 0

I have an application that syncs between 2 database: the central one is hosted on a Sql Server 2008 and the local one is a Sql Compact 3.5 database.

From time to time I need to upgrade the schema of one of the tables included in a sync scope and I do not want to deprovision and provision again, so I used this approach and for Sql Compact I have something like this:

public void UpdateProvisionSchema(string connString, string scopeName, string newConfigData)
{
    _log.Verbose("UpdateProvisionSchema: " + scopeName);

    try
    {
        string query = string.Format("SELECT [scope_config_id] FROM [scope_info] WHERE [sync_scope_name]='{0}'", scopeName);
        Guid config_id = (Guid)SqlCompactManager.ExecuteScalar(connString, query);

        string updateCommand = string.Format("UPDATE scope_config SET [config_data]='{0}' WHERE [config_id] ='{1}'", newConfigData, config_id);
        SqlCompactManager.ExecuteCommand(connString, updateCommand);
    }
    catch (Exception ex)
    {
        _log.Error(ex, string.Format("Failed to upgrade schema for scope {0}", scopeName));
        throw new Exception(string.Format("Update of provisioned schema failed for scope: {0}", scopeName));
    }
}

and I manually change the config scope for my table. I think the scope config I send is the correct one, because I generate it by provisioning an empty table.

I have just added a column to a table included in a sync scope (its data is only downloaded from central database to local database) and now I receive an error on ApplyChangeFailed.

It seems that in the Sql Compact database, the table included in the sync scope with the problem, has this column: __sysTrackingContext which does not exist on the central table.

First time I have created the tables and provisioned them and then I added 2 new columns (BusinessType, HideCommentAndSerialNumber ). If I look at the DbApplyChangeFailedEventArgs and examine the columns, I see the following:

Central:

..| BusinessType | HideCommentAndSerialNumber | sync_update_peer_timestamp | sync_update_peer_key | sync_create_peer_timestamp | sync_create_peer_key |

Local:

..| __sysTrackingContext | BusinessType | sync_update_peer_key | HideCommentAndSerialNumber | sync_update_peer_timestamp | sync_create_peer_key | sync_create_peer_timestamp |

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:45:19+00:00Added an answer on June 14, 2026 at 4:45 pm

    I have found the problem. The scope were the problem occurs, it only downloads data from central database to the local database.

    When I updated the table schema, I did the following:
    – add column to both databases
    – update the value of the new column on both databases
    – update provisioning schema on both databases

    The problem was that I executed a script that updates the column value on both databases. It only needs to be executed on the central database and the data will be downloaded to the client during synchronization.

    I have changed this and now it works; and it worked previously as well with similar scenarios (add/remove/change column type for tables already in synced scopes) .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that syncs with a web server. When I update I
I have wrote an application that syncs two folders together. The problem with the
I have an interface in CLR between SQL Server and the Exchange Web Services
I am using SQL Server 2005 Express and Visual Studio 2008. I have a
I am working on an application that involves maintaining consistency between two local directories.
I have an application that also has a web interface, one of the requirements
We are developing an occasionally connected application that uses SQL Compact on the client
I am working on a project which uses a relational database (SQL Server 2008).
I have an application that lets users record video from their webcams. The users
I have two (+) systems on a local network running an AIR application that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.