| Previous | Next |
| DB_E_BADDEFERRABILITY | DB_E_BADUPDATEDELETERULE |
DB_E_BADMATCHTYPE
Meaning
Windows documents DB_E_BADMATCHTYPE as “MatchType is invalid or the value is not supported by the provider”. In this case, a foreign-key constraint descriptor specifies an invalid or unsupported match 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.
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: match type and constraint type.
- Evidence 2: local and referenced column arrays.
- Evidence 3: provider-supported referential capabilities.
Conditions that specifically lead to it
- Cause 1: the match enumeration is invalid.
- Cause 2: the provider supports only a subset of match semantics.
- Cause 3: match behavior is supplied for a non-foreign-key constraint.
Diagnostic sequence
- Identify the exact failing stage: a foreign-key constraint descriptor specifies an invalid or unsupported match type.
Retry and recovery
Retry rule: retry after selecting a valid supported match type.
Corrective actions
- Action 1: use a documented match type for foreign keys.
- Action 2: omit match fields for unrelated constraint types.
- Action 3: verify null-handling semantics before choosing a fallback.
Practical scenario
A portable schema requests a match mode absent from the target provider; choosing the target-supported semantics prevents it.
Difference from nearby HRESULT values
DB_E_BADUPDATEDELETERULE concerns referential actions, while DB_E_BADMATCHTYPE concerns how composite foreign-key values match.
Official Microsoft references
Looking for a different code? Search another status or error code.