Answered by:
Syncing Non-Identical Tables

Question
-
Hi Everyone,
I have a requirement to keep 2 tables in sync. The details are similar to the following:
Database 1
Name - DB1
Table - Table1
Columns - Id, Firstname, SurnameDatabase 2
Name - DB2
Table - Table2
Columns - Key, FName, LNameI am new to the sync framework and was wondering if this is a typical scenario that can be solved using the framework? I have seen sample code where the database, tables and columns were similar but have seen very little information on scenarios similar to one I've outlined above.
My main concern is that implementing the above will involve a lot of custom code and the out-of-the-box benefits of the framework will be under utilized.
Thanks in advance,
Colin
Colin Meade (MCTS BizTalk Server)Sunday, April 10, 2011 4:21 PM
Answers
-
if the table names are different, try setting the GlobalName property of the SyncTableDescription
i.e.,
//provision TestTable on 1st peer DbSyncTableDescription TableXDescription; TableXDescription= SqlSyncDescriptionBuilder.GetDescriptionForTable( "TableX", (System.Data.SqlClient.SqlConnection)provider.Connection ); TableXDescription.GlobalName = "TestTable"; //provision TestTable on 2nd peer DbSyncTableDescription TableYDescription; TableYDescription= SqlSyncDescriptionBuilder.GetDescriptionForTable( "TableY", (System.Data.SqlClient.SqlConnection)provider.Connection ); TableYDescription.GlobalName = "TestTable";
- Proposed as answer by Ann Tang [MSFT]Microsoft employee Thursday, April 21, 2011 10:17 PM
- Marked as answer by Colin Meade Thursday, April 21, 2011 10:56 PM
Monday, April 11, 2011 3:07 PM
All replies
-
check this posts, the approach should be the same: http://jtabadero.wordpress.com/2011/03/14/upload-synchronization-where-the-client-and-server-primary-keys-are-different/ and http://jtabadero.wordpress.com/2011/03/14/part-2-bidirectional-synchronization-where-the-client-and-server-primary-keys-are-different/Sunday, April 10, 2011 11:32 PM
-
Thank you. I will check these out later on today.
Colin Meade (MCTS BizTalk Server)Monday, April 11, 2011 10:36 AM -
Hi June,
One of our team is getting the following error trying to sync two tables - TestTable and TestTable3.
"Cannot apply changes because the local provider does not have adapters configured for the following tables that were received from the remote provider: TestTable. Ensure that the correct adapters have been added to both providers for Scope 'TestScope', and that any table mapping has been correctly configured."
Is there a step that has been missed or is it possible to sync two tables with different names?
Many thanks,
Colin
Colin Meade (MCTS BizTalk Server)Monday, April 11, 2011 2:00 PM -
if the table names are different, try setting the GlobalName property of the SyncTableDescription
i.e.,
//provision TestTable on 1st peer DbSyncTableDescription TableXDescription; TableXDescription= SqlSyncDescriptionBuilder.GetDescriptionForTable( "TableX", (System.Data.SqlClient.SqlConnection)provider.Connection ); TableXDescription.GlobalName = "TestTable"; //provision TestTable on 2nd peer DbSyncTableDescription TableYDescription; TableYDescription= SqlSyncDescriptionBuilder.GetDescriptionForTable( "TableY", (System.Data.SqlClient.SqlConnection)provider.Connection ); TableYDescription.GlobalName = "TestTable";
- Proposed as answer by Ann Tang [MSFT]Microsoft employee Thursday, April 21, 2011 10:17 PM
- Marked as answer by Colin Meade Thursday, April 21, 2011 10:56 PM
Monday, April 11, 2011 3:07 PM