开发者

Is there a way to change SQL 2005 server's maximum decimal precision?

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)...


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜