none
Fastest way to code for synchronizing tables with different schema..

    Question

  • Hi,

    Let's say I have 2 tables.

    • Orders (Source Table)
      -- OrderID INT
      -- OrderTime DATETIME
      -- OrderStatus NVARCHAR(50)
    • Orders (Desitnation Table)
      -- OrderID INT
      -- OrderTime DATETIME
      -- OrderStatus NVARCHAR(50)
      -- OrderDescritpion NVARCHAR(200)

    I have 100s of tables with same case like above in my two databases. In many tutorials and examples, it is showing that I need to specifically write code to have extra columns removed at scope definition time. For example like below.

    • var clientTableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("DestinationOrderTable", clientConn);
      clientTableDesc.GlobalName = "OrderTable";
      clientScopeDesc.Tables.Add(clientTableDesc);
      clientScopeDesc.Tables["OrderTable"].Columns.Remove(clientScopeDesc.Tables["OrderTable"].Columns["OrderQty"]);
      clientProvision.PopulateFromScopeDescription(clientScopeDesc);
      clientProvision.Apply();

    Is there a way to tell sync framework to auto ignore the column differences? Like an option that can turn on or off? Or is there any other way? What will be the best way? Please advice.

    Thanks.

    Monday, October 14, 2013 4:00 AM