There are some common mistake related to DECIMAL data type to configure PRECISION and SACLE. Some time I saw that, people are making mistake on it, they just take whatever number they think not related to data storage. If we have confusion, we must solve it whether how tinny it is.
In my article I am going to illustrate this part. Hope you like it.
Numeric data types have fixed precision and scale.
DECIMLA (P, S)
PRECISION:
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 of 38. The default precision is 18.
When maximum precision is used, valid values are from - 10^38 +1 through 10^38 - 1.
SCLE:
The maximum number of decimal digits that can be stored to the right of the decimal point.
Default is the 0.
The maximum storage size is varies based on precision is described bellow
Precision | Storage bytes |
1 - 9 | 5 |
10-19 | 9 |
20-28 | 13 |
29-38 | 17 |
Hope this is quite informative and thanking you to provide your valuable time.
Posted by: MR. JOYDEEP DAS
No comments:
Post a Comment