What does HRESULT 0x87AF0613 (SQLITE_E_CONSTRAINT_PRIMARYKEY) mean?

 
Previous Next
SQLITE_E_IOERR_TRUNCATE SQLITE_E_IOERR_FSTAT

SQLITE_E_CONSTRAINT_PRIMARYKEY

SQLITE_E_CONSTRAINT_PRIMARYKEY corresponds to SQLITE_CONSTRAINT_PRIMARYKEY. The statement attempted to insert or update a row so that its primary key conflicts with an existing row.

What to check

  • Determine whether the key is application-assigned, generated, imported, or restored from another source.
  • Inspect concurrent writers and retry logic before treating the duplicate as bad source data.
  • For composite keys, compare every key column using the collation and affinity used by the table.
SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'your_table';

SQLite: SQLITE_CONSTRAINT_PRIMARYKEY

SQLite: PRIMARY KEY Constraints

SQLite: Conflict Resolution


Looking for a different code? Search another status or error code.