Using SQL Server 2008 Integrated Change Tracking to Optimize Data Synchronization
| I thought I would take the chance to talk to you a little bit about a major enhancements we have made with synchronization in SQL Server 2008. The feature I am referring to is called SQL Server 2008 Integrated Change Tracking.
The idea behind this feature is that it enables SQL Server to track data changes to your database rather than relying on you to create a change tracking technique. |
Why is this feature so great? Well in my experience I have found that DBA’s are less then enthusiastic when you tell them that in order to track changes, they will need to add triggers to each of the tables. Then they will either need to add an additional tracking column to that table (or to a separately linked table) and will need to create one tombstone table per table to track deletes. Oh, and by the way these triggers will need to be fairly complicated because you really need to deal with all of the isolation issues that come along with proper change tracking… and cross your fingers that these changes do not affect your existing applications. Not a fan of that idea? I am not surprised.
Well with SQL Server 2008, you can now simply turn on an option to enable change tracking. Then you tell SQL Server which tables you want it to monitor. From that point SQL Server will start monitoring these changes and store them in a separate change tracking table which you have access to. If you want to get the changes since a certain point in time you simply join the ChangeTable to your base table and presto you have all of the inserts, updates and deletes.
As an added bonus, this feature has been integrated into the existing Visual Studio SP1 beta that is now available for download. Guy Burstein has a great summary of this feature and I am going to steal one of his screen shots below.
Liam Cavanagh

