Error: The Maximum Limit for Index Key Column List Is 16
Issue
Syncs are failing with the following error:
F_JD20F2: DBMS error [Could not update the metadata that indicates table [schema].[table] is enabled for Change Data Capture. The failure occurred when executing the command 'sp_cdc_create_change_table_index'. The error returned was 1904: 'The index 'hvr_542624976_CT_idx' on table 'cdc.hvr_542624976_CT' has 18 columns in the key list. The maximum limit for index key column list is 16.'
Environment
Connector: HVA SAP ECC on SQL Server
Resolution
To resolve this issue, do the following:
- Check the number of columns in the source table's unique index.
- Determine whether the additional CDC columns cause the index to exceed the SQL Server 16-column limit.
- Reduce the number of columns in the source table's index so the CDC index does not exceed 16 key columns.
- If you can't modify the index, work with your database administrator to review the schema design.
Cause
This issue occurs when CDC creates an index that exceeds the SQL Server limit of 16 key columns per index. This may happen when the source table's unique index, combined with additional CDC columns, exceeds the limit.