In case you need to check if a database has SQL Server change tracking activated, you can use the sys view change_tracking_databases.
As it does only include the database_id, use this SQL statement to retrieve the status for a given database.
select * from sys.change_tracking_databases where database_id=(select database_id from sys.databases WHERE name = 'MyDatabase')
The result contains all information you can also configure using SQL Server Management Studio.
If you want to retrieve the state for a given table, use sys.change_tracking_tables.
More information on these two views can be found in Configuring and Managing Change Tracking.
No comments:
Post a Comment