How check if CDC is enabled on specific database and table in SQL Server by running a SQL query?
CodePudding user response:
From the documentation sys.sp_cdc_enable_db (Transact-SQL) in the Remarks section:
sys.sp_cdc_enable_db creates the change data capture objects that have database wide scope, including meta data tables and DDL triggers. It also creates the cdc schema and cdc database user and sets the is_cdc_enabled column for the database entry in the sys.databases catalog view to 1.
From the documentation sys.sp_cdc_enable_table (Transact-SQL), also in the Remarks section:
sys.sp_cdc_enable_table also creates the capture and cleanup jobs for the database if the source table is the first table in the database to be enabled for change data capture and no transactional publications exist for the database. It sets the is_tracked_by_cdc column in the sys.tables catalog view to 1.