What does HRESULT 0xC8000518 (hrTableInUse) mean?

 
Previous Next
hrTableDuplicate hrObjectNotFound

hrTableInUse

Locate the failure in the Jet call chain

hrTableInUse means open cursors or operations prevent an exclusive table change.

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

The key comparison is: hrTableLocked is a lock-mode conflict; this code can arise from ordinary outstanding references. The first useful observation is to enumerate table handles, duplicated cursors, active transactions, and schema-maintenance workers. 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 conditionopen cursors or operations prevent an exclusive table change
First corrective directionclose all users of the table and perform schema changes under a controlled exclusive window

Object existence should be compared with the full expected definition before a migration is skipped. A JET_TABLEID is a cursor-like handle owned by a session, not a persistent table identifier.

Questions the logs must answer

  • Code-specific observation: enumerate table handles, duplicated cursors, active transactions, and schema-maintenance workers.
  • the exact schema migration step and whether a previous attempt committed; associate it with this result rather than with a later generic exception.
  • the table/object metadata and normalized name; associate it with this result rather than with a later generic exception.
  • all JET_TABLEID owners, open modes, transactions, and current indexes.

Response and verification

  1. Freeze the failing request context and record 0xC8000518, the Jet API name, and the current instance/session ownership.
  2. Verify the code-specific precondition: enumerate table handles, duplicated cursors, active transactions, and schema-maintenance workers.
  3. Apply the targeted fix: close all users of the table and perform schema changes under a controlled exclusive window.
  4. Before retrying the operation, reconcile object definition, exclusive-access state, and migration version.

Distinguishing signals

hrTableDuplicatetable creation reused a name already present in the database
hrTableLockedthe target table is under a lock incompatible with the requested operation
hrObjectNotFounda valid object name does not exist in the selected database or table scope

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.