Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Enabling Change Data Capture transaction nesting

Author  Topic 

georged
Starting Member

1 Post

Posted - 2011-01-07 : 05:35:59
Hello All

I'm trying to enable change data capture on my development database.
I have enable CDC on the database -

I have checked this is working by running the query:

EXECUTE sys.sp_cdc_enable_db;
GO

I then run this script to enable CDC:


exec sys.sp_cdc_enable_table
@source_schema = N'dbo',
@source_name = N'test_table',
@role_name = NULL,
@capture_instance = N'test_table’,
@supports_net_changes = 1

To which I get the following error:

Msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal, Line 607
Could not update the metadata that indicates table [dbo].[test_table] is enabled for Change Data Capture. The failure occurred when executing the command 'sp_cdc_create_change_table'. The error returned was 3991: 'The context transaction which was active before entering user defined routine, trigger or aggregate "DDLTriggers" has been ended inside of it, which is not allowed. Change application logic to enforce strict transaction nesting.'. 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_enable_table_internal, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
Msg 3930, Level 16, State 1, Procedure sp_cdc_enable_table, Line 61
The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.
Msg 266, Level 16, State 2, Procedure sp_cdc_enable_table, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
Msg 3998, Level 16, State 1, Line 1
Uncommittable transaction is detected at the end of the batch. The transaction is rolled back

I so far checked:

I checked that:

Change Data Capture is enabled on the database.
The table has not is not CDC enable already.

I have also tried:
running the command on a test table with produces the same error.
Using a test database – this works and the CDC table is created

Is something interfering with the enable CDC on my development database?

-G


   

- Advertisement -