We are in the upgrade project from SQL 2014 to SQL 2019. We are facing the issue when our decimal calculation difference between SQL 2014 and SQL 2019.
From our test result SQL 2019 function AVG can handle only 6 decimal, if no datatype cast. But SQL 2014 can handle more decimal digit in the same method.
We conclude this issue as 2 root causes.
1.Result datatype may be difference between SQL 2014 and SQL 2019 when use function AVG without cast type.
2.Field overflow handle difference between SQL 2014 and SQL 2019. SQL 2014 handle last decimal at digit 6th without rounding anything. But SQL 2019 will use decimal digit 7th to rounding digit 6th as last digit before update value.
From our problems above, can we fix or use any middle function as one time fixing and apply all to handle decimal issue ? Due to there are a lot of points in our code that impact from above issue and we may not search 100%.