SAP Knowledge Base Article - Preview

2838779 - Error "duplicate key found" when trying to recreate a missing primary index


  • Transaction ST04 reports a missing primary index in a table.
  • When trying to create the missing index you get the following error:
cannot CREATE UNIQUE INDEX; duplicate key found: [5] Several documents with the same ID exist in the index;
<SCHEMA_NAME>:<TABLE_NAME>.$trexexternalkey$ content not unique, cannot define unique constraint. rowCount != distinctCount



  • SAP HANA 1.0 SPS12
  • SAP HANA 2.0


SAP ERP 6.0 ; SAP HANA 1.0, platform edition ; SAP HANA, platform edition 2.0


HANA, ST04, index, duplicate, table, database, missing, primary index , KBA , HAN-DB , SAP HANA Database , BC-DWB-DIC , ABAP Dictionary and ABAP CDS , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.