Day 17 of my virtual advent calendar, about stuff I like in SQL Server 2008..
Today’s topic is the confusingly named change tracking i.e. nothing to do with Change Data Capture (CDC) I mentioned in my last post. CDC is only in enterprise edition only and is there to primarily support population of data warehouses while Change Tracking is a developer orientated tool designed to support synchronisation across different platforms and is therefore included in all editions of SQL Server 2008.
Like CDC you need to turn it on either via the Management Studio (which you won’t have if your using Express) or via T-SQL..
ALTER DATABASE AdventureWorks SET CHANGE_TRACKING = ON (CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON)
The process relies on version numbers and every time a change is made this gets incremented and then this is used in various functions to get at the data..
@CurrentVersion = CHANGE_TRACKING_CURRENT_VERSION()
This is more a developer thing and so the virtual lab for this is on MSDN, and there is also more about it in Books On-Line here.
PingBack from http://bestwebhostingservices.com/andrew-fryers-blog-sql-server-advent-calendar-17-%e2%80%93-change-tracking/
Pour tous ceux qui ont gardé une âme d'enfant ! SQL Server Advent Calendar SQL Server Advent