The Change Data Capture feature seems to capture the ddl applied to the base table on CDC.ddl_history. However the _CT table doesn’t get updated automatically with the new schema definition.
Use Test
goEXEC sys.sp_cdc_enable_db
Select name, is_cdc_enabled from sys.databases
EXEC sp_cdc_enable_table ‘dbo’, ‘Address’, @role_name = NULL, @supports_net_changes =1
Select [name], is_tracked_by_cdc from sys.tables
select * from dbo.Addressselect * from cdc.dbo_Address_CT
alter table dbo.Address add AddressLine5 varchar(100)
select * from cdc.dbo_Address_CT AddressID ContactInfoID AddressLine1 AddressLine2 AddressLine3 AddressLine4 MunicipalityName ProvinceType CountryType PostalCode AddressType IsConfidential AddressID ContactInfoID AddressLine1 AddressLine2 AddressLine3 AddressLine4 MunicipalityName ProvinceType CountryType PostalCode AddressType IsConfidential———————————— ———————————— —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- ———————————— ———————————— ———— ———————————— ————–
AddressID ContactInfoID AddressLine1 AddressLine2 AddressLine3 AddressLine4 MunicipalityName ProvinceType CountryType PostalCode AddressType IsConfidential———————————— ———————————— —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- ———————————— ———————————— ———— ———————————— ————–(0 row(s) affected)
__$start_lsn __$end_lsn __$seqval __$operation __$update_mask AddressID ContactInfoID AddressLine1 AddressLine2 AddressLine3 AddressLine4 MunicipalityName ProvinceType CountryType PostalCode AddressType IsConfidential
———————- ———————- ———————- ———— —————————————————————————————————————————————————————————————————————————————————————— ———————————— ———————————— —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- ———————————— ———————————— ———— ———————————— ————–
(0 row(s) affected)
__$start_lsn __$end_lsn __$seqval __$operation __$update_mask AddressID ContactInfoID AddressLine1 AddressLine2 AddressLine3 AddressLine4 MunicipalityName ProvinceType CountryType PostalCode AddressType IsConfidential
———————- ———————- ———————- ———— —————————————————————————————————————————————————————————————————————————————————————— ———————————— ———————————— —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- —————————————————————————————————- ———————————— ———————————— ———— ———————————— ————–
(0 row(s) affected)
By the way, I am using the RC0 version of the SQL Server 2008. The behaviour may change in the future.