When using Sql 2008 Change Tracking is there a way to manually clean up the tracking tables?
I know about the CHANGE_RETENTION and AUTO_CLEANUP properties but would perfer more control over the cleanup.
Right click on the table you want to track changes. Click Properties, click Change Tracking, then in the right pane set Change Tracking to TRUE.
At the basic database level you can track changes by having a separate table that gets an entry added to it via triggers on INSERT/UPDATE/DELETE statements. Thats the general way of tracking changes to a database table. The other thing you want is to know which user made the change.
SQL Server provides two features that track changes to data in a database: change data capture and change tracking. These features enable applications to determine the DML changes (insert, update, and delete operations) that were made to user tables in a database.
You can also enable change tracking in SQL Server Management Studio by using the Database Properties (ChangeTracking Page) dialog box. If a database contains memory optimized tables, you can't enable change tracking with SQL Server Management Studio. To enable, use T-SQL.
Basically these Change Tracking information are stored in Internal Tables and no option to clean up manually. But still we can clear by disabling/enabling change tracking for a tables.
alter table <tableName> disable change_tracking
alter table <tableName> enable change_tracking
THis command will clean up all change tracking related to specific table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With