List all Tables that have Change Data Capture (CDC) enabled on a SQL Server Database

Change Data Capture (CDC) feature was introduced in SQL Server 2008, and is used to get the historical change information for a user table.

To list all tables that have Change Data Capture (CDC) enabled on a SQL Server database
, use the following query:

USE Database_Name
GO
SELECT s.name AS Schema_Name, tb.name AS Table_Name
, tb.object_id, tb.type, tb.type_desc, tb.is_tracked_by_cdc
FROM sys.tables tb
INNER JOIN sys.schemas s on s.schema_id = tb.schema_id
WHERE tb.is_tracked_by_cdc = 1

tables_CDC_enabled

You will get one row for each table that has Change Data Capture enabled in the current database.

If the post helped you, please share it:
Pin It

1 comment to List all Tables that have Change Data Capture (CDC) enabled on a SQL Server Database

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">