Sql Server - Precision Processing

I just read on Precision Handling on MSDN .

Derived from the table on this site:

Operation: e1 / e2

The accuracy of the result: p1 - s1 + s2 + max (6, s1 + p2 + 1)

Scale of results: max (6, s1 + p2 + 1)

Explanation of the expressions used:

The operand expressions are denoted as expression e1, with precision p1 and scale s1, and expression e2, with precision p2 and scale s2.

What I do not understand (moreover, I am not 100% sure, I understand this) is the expression

max(6, s1 + p2 + 1)

Can someone explain this to me?

Many thanks:)

+3
source share
1 answer

See my processed example here T-SQL decimal precision

6 (scale1 + precision2 + 1)

+4

Source: https://habr.com/ru/post/1773227/


All Articles