| Previous | Next |
| DB_E_NOSTATISTIC | DB_E_RESOURCENOTSUPPORTED |
DB_E_ALTERRESTRICTED
Meaning
Windows documents DB_E_ALTERRESTRICTED as “Column or table could not be altered because it is referenced by a constraint”. In this case, a table or column alteration is blocked because an existing constraint references the target.
Relevant contract
OLE DB DDL interfaces identify indexes, commands and constraints with provider-scoped DBIDs. Constraint descriptors also carry type, column arrays, match behavior, deferrability and update/delete rules that must agree as one structure.
Investigation of this result should start with the session performing DDL, target table metadata and the exact DBID or DBCONSTRAINTDESC supplied.
Conditions that specifically lead to the result
- Cause 1: a foreign key depends on the column.
- Cause 2: a check or unique constraint would become invalid.
- Cause 3: provider rules prohibit the requested alteration while the constraint exists.
Evidence to collect
When recording diagnostic data involving catalog names, schema names, object identifiers and deployment definitions, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.
- Evidence 1: target table and column DBIDs.
- Evidence 2: blocking constraint definitions.
- Evidence 3: whether transactional DDL can preserve atomicity.
Diagnostic sequence
- Identify the exact failing stage: a table or column alteration is blocked because an existing constraint references the target.
Corrective actions
- Action 1: alter or drop dependents in a reviewed order.
- Action 2: recreate equivalent constraints after the compatible schema change.
- Action 3: avoid disabling integrity without a validation plan.
Retry and recovery
Retry rule: retry after blocking constraints have been removed or changed consistently.
Practical scenario
A migration narrows a referenced key column before updating its foreign key; coordinating both definitions prevents it.
Difference from nearby HRESULT values
DB_E_DROPRESTRICTED blocks dropping a referenced object, while DB_E_ALTERRESTRICTED blocks changing one.
Official Microsoft references
Looking for a different code? Search another status or error code.
