ERROR

Violation of PRIMARY KEY constraint [value]. Cannot insert duplicate key in object [value]. The duplicate key value is [value].

Last Published: March 30, 2021

Error Message

When managing versioned data with operations such as compress or reconcile/post, the following error message may be returned:

Error:   
Violation of PRIMARY KEY constraint [value]. Cannot insert duplicate key in object [value]. The duplicate key value is [value].

Cause

Inconsistencies discovered between the adds and deletes tables, such as detached or duplicate rows in the delta tables or versioned business table. These inconsistencies can be caused by various editing methods, for example, skipping an intermediate version during reconcile/post.

Note:
When reconciling versions, it is recommended to use the Reconcile Order tab in the Geodatabase Administration dialog box. For more information, refer to ArcMap: Recommended reconcile order.

Solution or Workaround

To resolve this issue, identify and repair inconsistencies within the versioned tables, as described below:

Note:
Only a geodatabase administrator has the privileges to run the diagnose and repair tools. Make sure to take a database backup and that no one is editing in the geodatabase before running the repair. 
  1. Run the Diagnose Version Tables tool. This tool produces logs that identify the feature class version tables with inconsistencies.
    1. In Catalog, navigate to System Toolboxes > Data Management Tools > Geodatabase Administration > Diagnose Version Tables
    2. In the Diagnose Version Tables window, assign the desired input database connection and the diagnose version tables log location, and click OK.
  2. Run the Repair Version Tables tool to address any inconsistencies from Step 1.
    1. In Catalog, navigate to System Toolboxes > Data Management Tools > Geodatabase Administration > Repair Version Tables.
    2. In the Repair Versions Tables window, assign the desired input database connection and the repair versions tables log, and click OK.
Note:
Refer to the help documents for additional parameters for the tools. Links are listed below. 

Article ID:000016425

Software:
  • ArcMap 10 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic