USE TEST
GO
库开启cdc
EXEC sys.sp_cdc_enable_db
GO
EXEC sys.sp_cdc_help_change_data_capture
EXEC xp_servicecontrol N'querystate', N'SQLServerAGENT';
SELECT name, is_tracked_by_cdc FROM sys.tables WHERE name = 'user6';
表开启
EXEC sys.sp_cdc_enable_table
@source_schema = N'dbo',
@source_name = N'ttab',
@role_name = null,
--@filegroup_name = N'',
@supports_net_changes = 0
GO
查看表是否开启,有则开启了
EXEC sys.sp_cdc_help_change_data_capture