decimal & numeric (data type)
data type decimal & numeric
What changes
- Input
- none
- Output or change
- none
Syntax at a glance
decimal [ ( p [ , s ] ) ] | numeric [ ( p [ , s ] ) ]
Work example
Store exact quantities, rates, or amounts with a known maximum precision and scale.
Choose precision and scale from the business range, then test multiplication and division result types.
Check your work decimal and numeric are synonyms, and precision or scale changes can round or overflow values.
Practice SQL
Open in SQL FlowSELECT CAST(1234.56 AS decimal(12,2)) AS amount;
Open Microsoft Learn for full syntax, permissions, and details for your version.