FIX: Cannot enable "change data capture" on a table that uses a unique index with more than one included column in SQL Server 2012 or 2014

Symptoms

You create a unique index that contains two or more included columns for a table in Microsoft SQL Server 2012 Service Pack 2 (SP2) or SQL Server 2014. When you try to enable change data capture for the table, you receive an error message that resembles the following:

Msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal, Line 636

Could not update the metadata that indicates table table_name is enabled for Change Data Capture. The failure occurred when executing the command 'insert into table_name'. The error returned was 2627: 'Violation of PRIMARY KEY constraint 'index_columns_clustered_idx'. Cannot insert duplicate key in object 'cdc.index_columns'. The duplicate key value is (338100245, 0).'. Use the action and error to determine the cause of the failure and resubmit the request.

Cumulative Update information

This issue was first fixed in the following cumulative update of SQL Server:


Recommendation: Install the latest cumulative update for SQL Server

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References

Learn about the terminology that Microsoft uses to describe software updates.
Properties

Article ID: 3076444 - Last Review: Aug 17, 2015 - Revision: 1

Feedback