numeric datatype | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

numeric datatype

hi, i’ve got ready made table and one of it’s column is having numeric and 9 lenghth,
its precision is 10 and scale is 2,
can anyone explain how it works?
THIS IS FROM BOL decimal and numeric
Numeric data types with fixed precision and scale. decimal[(p[, s])] and numeric[(p[, s])] Fixed precision and scale numbers. When maximum precision is used, valid values are from – 10^38 +1 through 10^38 – 1. The SQL-92 synonyms for decimal are dec and dec(p, s). p (precision) Specifies the maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision. The maximum precision is 38. s (scale) Specifies the maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p. The default scale is 0; therefore, 0 <= s <= p. Maximum storage sizes vary, based on the precision. Precision Storage bytes
1 – 9 5
10-19 9
20-28 13
29-38 17 Surendra Kalekar
can use float and real
Approximate number data types for use with floating point numeric data. Floating point data is approximate; not all values in the data type range can be precisely represented.
Cast your vote

In SQL Server, I think Numeric and Decimal are same Madhivanan Failing to plan is Planning to fail
Yes. Though there is a subtle difference between NUMERIC and DECIMAL in the SQL 92 standard, SQL Server implements them equally. —
Frank Kalis
Microsoft SQL Server MVP
Heute schon gebloggt?
Ich unterstütze PASS Deutschland e.V.