5

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?

1
  • 3
    Why do you use LEFT JOIN and WHERE that actually makes it INNER JOIN ? Commented Jun 23, 2012 at 13:56

1 Answer 1

6

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.

2
  • Exact. The job was in failed state, and the history displayed the errors. Thank you for the hint. Commented Jun 23, 2012 at 23:19
  • Among 2 steps: Step 1: starting change data capture works fine, Step 2: Change data capture collection agent not working and also I didn't get any error. How to identify the issue of step2. Commented Apr 17, 2020 at 15:00

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.