Reputation: 118
Is there a way to use Microsoft Sync Framework without implementing the required schema changes ('_tracking tables'). Basically, I am faced with the task of Syncing two SQL Server 2008 databases, one of which is a legacy db that we cannot make any schema changes to.
Would it be possible to store the additional tables required for each database in a separate database?
e.g. I have 3 tables that we need to sync (Staff, Customer & Sales), normally we would just add the three additional tracking tables, but this isn't possible. Instead, can I have a separate database with the required tracking tables (Staff_tracking, Customer_tracking, Sales_tracking) and somehow point the sync framework to this new db??
Any help is appreciated, and a code example would be super!
Upvotes: 2
Views: 996
Reputation: 1863
Since you are using SQL 2008 as the database, just turn on change tracking and let SQL Server track the change tables for you internally without having to change the schema of the actual client database. MSDN explains it nicely in this article. About half way down you will see the following:
SQL Server 2008 has introduced a new alternative method for tracking changes called SQL Server 2008 Change Tracking. The concept behind change tracking is that an administrator marks certain tables to be monitored for changes. From that point SQL Server 2008 keeps tracks of any inserts, updates, or deletes that are made. When a remote “requestor” requests changes, SQL Server 2008 will provide all of the changes that have occurred since the last successful download as specified by the requestor. The Sync Framework database synchronization providers have been built to take advantage of SQL Server 2008 change tracking and provide the following advantages for an OCA environment:
- No schema changes are required to be able to track changes.
Assuming you are using the standard Microsoft synchronization providers, change tracking support is included by default.
Upvotes: 1