What does HRESULT 0xC800057D (hrIndexMustStay) mean?

 
Previous Next
hrIndexNotFound hrIndexInvalidDef

hrIndexMustStay

Diagnostic focus

hrIndexMustStay means the requested delete would remove an index required by the table layout, commonly the clustered index.

This is the legacy Directory Service backup/restore HRESULT form of JET_errIndexMustStay (0xC800057D).

The key comparison is: hrIndexInUse is temporary runtime use; this code expresses a structural requirement. The first useful observation is to identify primary/clustered flags and every schema dependency before deletion. This evidence separates index schema, current-index cursor state, key construction, and duplicate data.

The ESE objects in play

Diagnostic layerB-tree index definition, key construction, uniqueness, and current-index cursor state
Typical API surfaceJetCreateIndex, JetDeleteIndex, JetSetCurrentIndex, JetMakeKey, JetSeek, and JetSetIndexRange
Code-specific conditionthe requested delete would remove an index required by the table layout, commonly the clustered index
First corrective directionrebuild the table with the desired layout instead of deleting the mandatory index in place

Index schema and runtime key-building state are separate diagnostic layers. Key bytes depend on segment order, column representation, collation, null rules, and sort direction.

Evidence that resolves the ambiguity

  • Code-specific observation: identify primary/clustered flags and every schema dependency before deletion.
  • the raw index key definition, flags, locale, and conditional columns; associate it with this result rather than with a later generic exception.
  • the current index plus every JetMakeKey segment and grbit.
  • the encoded key and existing row when uniqueness is involved.

Nearby results that mean something different

hrIndexInvalidDefthe index key definition, flags, locale, or conditional metadata is internally invalid
hrIndexNotFoundthe requested index name is valid but absent from the table
hrIndexInUsean index definition is being used by an open cursor or operation that prevents the requested schema change

A disciplined correction path

  1. Freeze the failing request context and record 0xC800057D, the Jet API name, and the current instance/session ownership.
  2. Verify the code-specific precondition: identify primary/clustered flags and every schema dependency before deletion.
  3. Apply the targeted fix: rebuild the table with the desired layout instead of deleting the mandatory index in place.
  4. Before retrying the operation, reconcile index definition, selected cursor index, and key or uniqueness outcome.

Actions that can hide or worsen the problem

  • Do not drop or rebuild an index before checking uniqueness and table-layout dependencies.
  • Do not treat a key-construction or duplicate-key result as database-file corruption.

Technical references


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