SQL Server Developer Center >
SQL Server Forums
>
SQL Server Replication
>
Disabling of CDC for a database fails
Disabling of CDC for a database fails
- We have a database with cdc enabled for several tables, but when trying to disable cdc for the database this error happens:
Msg 22831, Level 16, State 1, Procedure sp_cdc_disable_db_internal, Line 216
Could not update the metadata that indicates database AgricultureSubsidy is not enabled for Change Data Capture. The failure occurred when executing the command '.sys.sp_replhelp N'DisablePerDbHistoryCache''. The error returned was 3930: 'The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.'. Use the action and error to determine the cause of the failure and resubmit the request.
Msg 266, Level 16, State 2, Procedure sp_cdc_disable_db_internal, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 2.
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 = 2.
Msg 3998, Level 16, State 1, Line 1
Uncommittable transaction is detected at the end of the batch. The transaction is rolled back.
The error has been described on Microsoft connect and reported fixed back in 2008.
The same error now appears with both without SP1 and with SP1, on sql server version:
Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.0 <X64> (Build 6001: Service Pack 1) (VM)
We have disabled all of the tabled for cdc, but can not disable database.
How can this be fixed?
All Replies
Can you give more detail about how this is being executed? Via TSQL? Inside an app? Is it wrapped in a transaction?
THe underlying eror is "The failure occurred when executing the command '.sys.sp_replhelp N'DisablePerDbHistoryCache''". Are you able to execute this statement manually?
This may end up being a bug and you'll have to open a support case to have an engineer investigate the problem in more detail.- The statment is being executed via TSQL from Manangement Studio, it is not wrapped in a transaction. We have tired to detach/attach the database with no change in behaviour.


