Why CDC records nothing while being enabled?

Posted on

Question :

I enabled Change Data Capture on some tables in a Microsoft SQL 2008 database. Both of the following queries return 1:

select top 1 is_cdc_enabled from sys.databases where name = N'<DatabaseName>'

select top 1 T.[is_tracked_by_cdc]
    from sys.tables as T
        left join sys.schemas as S
        on T.[schema_id] = S.[schema_id]
    where S.[name] = N'<SchemaName>' and T.[name] = N'<TableName>'

but when I change the data of a concerned table, cdc.<SchemaName>_<TableName>_CT remains empty.

Why?

Answer :

Check to make sure the SQL Agent is running, and that there is a capture job created that is enabled and running for the CDC instance, it should show Change Data Capture Collection Agent / executing.

Leave a Reply

Your email address will not be published. Required fields are marked *