Which Databases and Tables Did You CDC-Enable?

Home > Blogs > SQL Server > Which Databases and Tables Did You CDC-Enable?

Which Databases and Tables Did You CDC-Enable?

Like This Blog 0 Peter Avila
Added by December 16, 2013

In the 10777 course on data warehouses, we see how to use an SQL Server technology called Change Data Capture. We see how CDC allows data changes made to a line-of-business database to be captured so that we can incrementally update a data warehouse by applying those captured changes to it. We also learn that, before CDC can be used, both the database and the individual tables where changes need to be tracked must be CDC-enabled.

And all that works very well. But, once CDC has been enabled, how do you find out what databases and tables are CDC-enabled? Simple. There are two system views we can use, sys.databases and sys.tables. Each of these views has a column that indicates whether or not a row in the view is CDC-enabled, though their names are not the same; one is called is_cdc_enabled and the other is is_tracked_by_cdc.

Use this query to find databases that are CDC-enabled:

     SELECT name
     FROM sys.databases
     WHERE  is_tracked_by_cdc =  1
     Go

Use this query to find tables that are CDC-enabled:

     USE –<a CDC-enabled database>
     Go

    SELECT name
    FROM sys.tables
    WHERE is_tracked_by_cdc =  1
    Go

Enjoy!
Peter Avila
SQL Server Instructor – Interface Technical Training
Phoenix, AZ

Videos You May Like

Agile Methodology in Project Management

0 153 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

Windows 10 Managing, Deploying and Configuring – December 2, 2015

0 434 1

In this recorded Windows 10 training webinar from December 2, 2015, Windows Server instructor Rick Trader presents the deployment and management of Windows 10 Enterprise and the new Provisioning capability in Windows 10. Learn how to manage Windows 10 deployments using System Center Configuration Manager, Mobile Device Management and Intune. Also included in his presentation … Continue reading Windows 10 Managing, Deploying and Configuring – December 2, 2015

Detailed Forensic Investigation of Malware Infections – April 21, 2015

4 608 5

How does an investigator hunt down and identify unknown malware? In this recording of our IT Security training webinar on April 21, 2015, Security expert Mike Danseglio (CISSP / CEH) performed several malware investigations on infected computers and identify symptoms, find root cause, and follow the leads to determine what’s happening. He demonstrated his preferred … Continue reading Detailed Forensic Investigation of Malware Infections – April 21, 2015

Write a Comment

Share your thoughts...

Please fill out the comment form below to post a reply.