Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question
3  
Why do you use LEFT JOIN and WHERE that actually makes it INNER JOIN ? –  a1ex07 Jun 23 '12 at 13:56
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
    
Exact. The job was in failed state, and the history displayed the errors. Thank you for the hint. –  MainMa Jun 23 '12 at 23:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.