CDC supports two instances of capture tables. So, You can do following steps:
- Add new column
- Add new cdc-capture inctance
- Move data from old table to the new one
- Disable old cdc instance
This solution prevent you from stopping collecting changes and you won't lose data.
EXEC sp_cdc_enable_table
@source_schema = N'common',
@source_name = N'EntityTypes',
@role_name = NULL,
@filegroup_name = N'CDC',
@capture_instance = 'common_EntityTypes'
ALTER TABLE common.EntityTypes
ADD TestColumn int
EXEC sp_cdc_enable_table
@source_schema = N'common',
@source_name = N'EntityTypes',
@role_name = NULL,
@filegroup_name = N'CDC',
@capture_instance = 'common_EntityTypes2'
INSERT INTO cdc.common_EntityTypes2_CT
(__$start_lsn, __$end_lsn,__$seqval,__$operation,__$update_mask,Id,Name)
SELECT
__$start_lsn,
__$end_lsn,
__$seqval,
__$operation,
__$update_mask,
Id,
Name
FROM cdc.common_EntityTypes_CT
EXEC sp_cdc_disable_table
@source_schema = N'common',
@source_name = N'EntityTypes',
@capture_instance = 'common_EntityTypes'