Hi All,I am experimenting with Change Tracking (Not CDC, yet) to identify rows in a small subset of tables to be loaded into a a data warehouse (Well, I suppose Mart, its a single fact + 5 dimension, nothing spectacular).I've enabled Change Tracking:[code="sql"]ALTER DATABASE TrackerDBSET CHANGE_TRACKING = ON(CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON);GOALTER TABLE dbo.TrackMEENABLE CHANGE_TRACKINGWITH (TRACK_COLUMNS_UPDATED = ON);[/code]I then made a couple of changes, inserts and an update. Which I *can* identify using CHANGETABLE function, however, I am struggling to understand the version parameter.[code="sql"]select CHANGE_TRACKING_CURRENT_VERSION();-- This returns the value 2[/code]So, If I were to perform an INSERT and then an UPDATE, am I correct in thinking the latest version would have lost the fact that a NEW row was added and it would then look like a only a row update has taken place.. Thus making this no good for tracking changes to be loaded into a data warehouse.Or am I missing a trick? I like the lightweight nature of this change tracking approach but not sure it's going to work in my place.EDIT: I should all, all I really want to achieve is a list of ID's that have changed since a given a date, be them new rows, updated rows, etc.. Deletes I am not too bothered about as no deletes occur on these tables. Any thoughts?Cheers,Alex
↧