Click to Rate and Give Feedback
TechNet
TechNet Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
 sys.sp_cdc_enable_db (Transact-SQL)

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
SQL Server 2008 Books Online (June 2009)
sys.sp_cdc_enable_db (Transact-SQL)

Enables change data capture for the current database. This procedure must be executed for a database before any tables can be enabled for change data capture in that database. Change data capture records insert, update, and delete activity applied to enabled tables, making the details of the changes available in an easily consumed relational format. Column information that mirrors the column structure of a tracked source table is captured for the modified rows, along with the metadata needed to apply the changes to a target environment. Change data capture is available only in SQL Server 2008 Enterprise, Developer, and Evaluation editions.

Topic link icon Transact-SQL Syntax Conventions

sys.sp_cdc_enable_db

0 (success) or 1 (failure)

None

Change data capture cannot be enabled on system databases or distribution databases.

sys.sp_cdc_enable_db creates the change data capture objects that have database wide scope, including meta data tables and DDL triggers. It also creates the cdc schema and cdc database user and sets the is_cdc_enabled column for the database entry in the sys.databases catalog view to 1.

Requires membership in the sysadmin fixed server role.

The following example enables change data capture for the AdventureWorks database.

USE AdventureWorks;
GO
EXECUTE sys.sp_cdc_enable_db;
GO
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker