I am multiplying the values of a few decimal columns together in SQL Server 2005 in a stored procedure. The SP already has tens of calculations.
The problem is that there's precision being lost. Instead of the result of the calculation having precision of the largest precision involved in the calculation, it's 6 decimal points. I don't know if that's a SQL Server default. None of the columns has 6 decimal points.
Arbitrary example of problem:
column1(10,10) * column2 (8,8) * column3(8,5) results in say decimal(10,6).
I need the precision to be 10 instead of 6.
I know I can cast all the columns and calculations to what I want but that's too much work for a bunch of complicated stored procedures.
Is there a general default I can force in the SP?
Something like 'SET DECIMALPRECISION 10'? (I made that up)
EDIT: It's scale instead of precision