Created
July 28, 2017 00:40
-
-
Save jcorderodr/eb4d47a9203dc71e8fe8a9ce48a6a86b to your computer and use it in GitHub Desktop.
MSSQL - Change Tracking Scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- To know wich tables are Tracking enable | |
| SELECT sys.schemas.name as Schema_name, sys.tables.name as Table_name FROM sys.change_tracking_tables | |
| JOIN sys.tables on sys.tables.object_id = sys.change_tracking_tables.object_id | |
| JOIN sys.schemas on sys.schemas.schema_id = sys.tables.schema_id | |
| --Enable Tracking on 'abc' table | |
| ALTER TABLE dbo.abc ENABLE CHANGE_TRACKING WITH (TRACK_COLUMNS_UPDATED = OFF) | |
| -- More info: https://msdn.microsoft.com/en-us/library/bb933875%28v=sql.105%29.aspx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment