What is precision: The total number of decimal digits that can be stored, including the left and right digits of the decimal point. The precision must be a value from 1 to the maximum precision 38. The default precision is 18.
Scale: The maximum number of decimal digits that can be stored to the right of the decimal point. The number of decimal places must be a value from 0 to P. You can specify the number of decimal places only after you specify the precision. The default number of decimal places is 0; therefore, 0 <= s <= p. The maximum storage size varies based on precision.
It is also necessary to set the precision of the parameter and the number of decimal digits when invoking the SqlParameter parameter in C Sharp, as the following example declares a decimal type parameter with a precision of 18 small tree digits of 2:
Copy Code code as follows:
SqlParameter parm = new SqlParameter ("@parmName", sqldbtype.decimal);
Parm. Precision = 18;
Parm. Scale = 2;