How to enable Change Data Capture on one or more tables in a SQL Server Database?

You can enable CDC on one or more table using below T-SQL Statement

Use [Your_Database_name]

EXEC sys.sp_cdc_enable_table
@source_schema = N'Your_Schema_name', --Table Schema name such as dbo
@source_name = N'Table_name', --Table name that you would like to enable CDC on such as mytable
@role_name = NULL,
@filegroup_name = N'FilegroupName' -- File Group for Change Data Capture table such as Secondary

No comments:

Post a Comment