Data Replication
- Data Replication 9.7.0
- All Products
-- Repeat the following database block for each database for which to enable Change Data Capture. -- BEGIN DATABASE BLOCK usedatabase_nameEXECUTE sys.sp_cdc_enable_db -- In each database block, repeat the following table block for each table in the database -- for which to enable Change Data Capture. -- BEGIN TABLE BLOCK execute sys.sp_cdc_enable_table @source_schema = N'owner_name' , @source_name = N'table_name' , @role_name = NULL -- END TABLE BLOCK -- END DATABASE BLOCK EXEC sp_configure 'max text repl size', 2147483647 RECONFIGURE WITH OVERRIDE
Alternatively, to disable Microsoft SQL Server Change Data Capture for all of the tables in a particular database, use the following script:-- Repeat the following database block for each database for which to disable Change Data Capture. -- BEGIN DATABASE BLOCK usedatabase_name-- In each database block, repeat the following table block for each table in the database -- for which to disable Change Data Capture. -- BEGIN TABLE BLOCK execute sys.sp_cdc_disable_table @source_schema = N'owner_name' , @source_name = N'table_name' , @capture_instance = 'all' -- END TABLE BLOCK -- END DATABASE BLOCK
usedatabase_nameEXECUTE sys.sp_cdc_disable_db