If you need more information on this feature, the best place to start is here : Track data changes with SQL Server
SqlSyncChangeTrackingProvider is compatible with all others sync providers: You can have a server database using the
SqlSyncChangeTrackingProvider and some clients databases using any of the others providers.
What does it mean to use Change Tracking from within your database ?
- No more tracking tables in your database
- No more triggers on your tables in your database
- Metadatas retention managed by SQL Server itself
- Changes tracked by the SQL Engine, way better performances than using triggers and tracking tables
To be able to use
SqlSyncChangeTrackingProvider on your database, do not forget to activate the Change Tracking on your database :
ALTER DATABASE AdventureWorks SET CHANGE_TRACKING = ON (CHANGE_RETENTION = 14 DAYS, AUTO_CLEANUP = ON)
You don’t have to activate Change Tracking on each table. It will be enabled by DMS on each table part of the sync process.
Once it’s done, the code is almost the same:
var serverProvider = new SqlSyncChangeTrackingProvider("Data Source=...."); var clientProvider = new SqlSyncChangeTrackingProvider("Data Source=....");