| Previous | Next |
| DB_E_BADMATCHTYPE | DB_E_BADCONSTRAINTID |
DB_E_BADUPDATEDELETERULE
Meaning
Windows documents DB_E_BADUPDATEDELETERULE as “Constraint update rule or delete rule is invalid”. In this case, a foreign-key constraint requests an invalid update or delete rule.
Conditions that specifically lead to the result
- Cause 1: the referential-action enumeration is invalid.
- Cause 2: the provider does not support cascade or set-null behavior.
- Cause 3: the rule conflicts with column nullability or constraint type.
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.
Diagnostic sequence
- Identify the exact failing stage: a foreign-key constraint requests an invalid update or delete rule.
Evidence to collect
- Evidence 1: update rule, delete rule and constraint type.
- Evidence 2: referenced and referencing column metadata.
- Evidence 3: provider referential-action capabilities.
Corrective actions
- Action 1: choose supported referential actions.
- Action 2: validate set-null rules against nullable columns.
- Action 3: implement application-side behavior only with equivalent transactional guarantees.
Practical scenario
A foreign key requests SET NULL on a nonnullable column; selecting a compatible rule avoids it.
Retry and recovery
Retry rule: retry after correcting both referential-action rules.
Difference from nearby HRESULT values
DB_E_BADMATCHTYPE concerns key matching, while DB_E_BADUPDATEDELETERULE concerns actions after parent updates or deletes.
Official Microsoft references
Looking for a different code? Search another status or error code.