Consider the following scenario:
- In Microsoft SQL Server 2008, you enable the change data capture (CDC) feature for a database.
- You drop the cdc.change_tables CDC system table.
- You run the sp_cdc_disable_db stored procedure to disable CDC.
In this scenario, you may receive the following error message:
Msg 208, Level 16, State 1, Procedure sp_cdc_disable_db_internal, Line 82 Invalid object name 'cdc.change_tables'.
Msg 266, Level 16, State 2, Procedure sp_cdc_disable_db_internal, Line 82 Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
Msg 266, Level 16, State 2, Procedure sp_cdc_disable_db, Line 0 Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
If you try to re-enable CDC for the database by using the sys.sp_cdc_enable_db stored procedure, you may receive the following message:
Database '<Database>' is already enabled for Change Data Capture. Ensure that the correct database context is set, and retry the operation. To report on the databases enabled for Change Data Capture, query the is_cdc_enabled column in the sys.databases catalog view.