| Previous | Next |
| DB_E_BADPRECISION | DB_E_BADTABLEID |
DB_E_BADSCALE
Meaning
Windows documents DB_E_BADSCALE as “Scale is invalid”. Here, a column, parameter or binding specifies a scale value invalid for its type or precision.
Evidence to collect before changing the system
- Evidence 1: the DBTYPE, precision and scale tuple.
- Evidence 2: provider type metadata.
- Evidence 3: the source schema mapping that produced the scale.
Relevant OLE DB contract
This result must be interpreted against this contract: OLE DB schema contracts combine DBIDs, provider type metadata, column attributes, constraints and locale rules; current provider metadata is authoritative; cached ordinals or type assumptions can become invalid after a schema or command change.
Start with the table, column, parameter or schema object named by the failing definition or data operation when investigating this result.
Specific conditions that produce it
- Cause 1: scale is greater than precision.
- Cause 2: scale lies outside the provider's supported range.
- Cause 3: scale is set for a nonnumeric type.
Corrective actions
- Action 1: enforce scale not exceeding precision.
- Action 2: map numeric definitions to provider-supported ranges.
- Action 3: omit scale where the selected type does not use it.
Practical incident
A decimal column is generated with precision 10 and scale 12; validating the tuple before table creation prevents it.
Retry and recovery policy
Retry rule: retry after correcting the scale or choosing a compatible numeric type.
Difference from related HRESULT values
DB_E_BADPRECISION concerns total significant digits, while DB_E_BADSCALE concerns digits to the right of the decimal point.
Official Microsoft references
Looking for a different code? Search another status or error code.