views:

20

answers:

1

Help says:

By default, the maximum precision returns 38.

Examples: SELECT @@MAX_PRECISION

Of course it is. That should mean, you can somehow change it, right? But I can't find an option for it. Is there some hidden crypted registry key or something?

The problem is that not all applications support precision > 24 and treat such values as text O_o But aggregate functions always return max precision if they not forced to something else.

For example, i need only 15 digits in all queries that return decimals, and don't want to manually CAST every SUM/MIN/MAX operator to decimal(10, 5)...

+1  A: 

The MAX_PRECISION simply reflects the maximum internal size of your SQL-Server's representation of floating point numbers. Thus you cannot change it. It's like a parameter telling you that you have 4 GB of memory installed. There is no registry hack to change that amount :-)

However you can specify less than this value in the column datatype or, as you pointed out, you can convert the results.

TToni
Yes, I was afraid it's read-only, but that "By default" totally confused me :-)
Bob Tail
Hi Bob. If my answer was satisfactory, please accept it through a klick on that large green hook. Apart from giving me some "karma points" it will also increase the likelyhood of people answering your future questions ;-)
TToni