What does HRESULT 0xC800051C (hrTableNotEmpty) mean?

 
Previous Next
hrDensityInvalid hrInvalidTableId

hrTableNotEmpty

Diagnostic focus

hrTableNotEmpty means a clustered-index definition or structural operation requires an empty table but rows already exist.

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

The key comparison is: hrContainerNotEmpty is a general child-object condition; this result is tied to table contents and clustered layout. The first useful observation is to measure row count, current indexes, migration stage, and whether data loading began prematurely. This evidence distinguishes name collisions, stale table handles, active users, locks, and structural dependencies.

The ESE objects in play

Diagnostic layertable and schema-object ownership, locks, and structural dependencies
Typical API surfaceJetOpenTable, JetCreateTableColumnIndex, JetDeleteTable, and schema enumeration APIs
Code-specific conditiona clustered-index definition or structural operation requires an empty table but rows already exist
First corrective directioncreate the clustered definition before loading data or rebuild into a new table under a migration plan

A JET_TABLEID is a cursor-like handle owned by a session, not a persistent table identifier. Schema changes commonly require exclusive access and a specific transaction state.

Evidence that resolves the ambiguity

  • Code-specific observation: measure row count, current indexes, migration stage, and whether data loading began prematurely.
  • all JET_TABLEID owners, open modes, transactions, and current indexes; associate it with this result rather than with a later generic exception.
  • the exact schema migration step and whether a previous attempt committed.
  • the table/object metadata and normalized name.

Nearby results that mean something different

hrTableLockedthe target table is under a lock incompatible with the requested operation
hrContainerNotEmptya container-level delete or structural change was requested while dependent objects remain
hrTableInUseopen cursors or operations prevent an exclusive table change

A disciplined correction path

  1. Freeze the failing request context and record 0xC800051C, the Jet API name, and the current instance/session ownership.
  2. Verify the code-specific precondition: measure row count, current indexes, migration stage, and whether data loading began prematurely.
  3. Apply the targeted fix: create the clustered definition before loading data or rebuild into a new table under a migration plan.
  4. Before retrying the operation, reconcile object definition, exclusive-access state, and migration version.

Actions that can hide or worsen the problem

  • Do not force a schema mutation while table users remain active.
  • Do not skip a migration merely because an object with the same name exists.

Technical references


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