首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

sqlserver 2005 四舍五入的bug?该怎么解决

2012-01-29 
sqlserver 2005 四舍五入的bug?round函数。。selectround(0.6)selectround(9.6)报错!!Anerroroccurredwhilee

sqlserver 2005 四舍五入的bug?
round函数。。

select   round(0.6)

select   round(9.6)

报错!!

An   error   occurred   while   executing   batch.   Error   message   is:   Arithmetic   Overflow.


大虾们又没有碰到过?

难道是2005的bug?

好像2000不会报错。。

[解决办法]
试过了,确实如此
在2005的managementstudio中连接2000和2005进行查询,结果一样,都出错
应该是bug吧

在2000的查询分析器中连接2000和2005进行查询,结果一样,都不出错
[解决办法]
我在数据库执行select round(9.6,0),报了一个好像是溢出的错误,不可以这样写么?

[解决办法]
看了一下,在SQL2000里面没事(我的是打了补丁sp4),在2005中不行(打了补丁sp2)!
[解决办法]
应该处在 length 的问题.

numeric_expression 的舍入精度。length 必须是 tinyint、smallint 或 int。如果 length 为正数,则将 numeric_expression 舍入到 length 指定的小数位数。如果 length 为负数,则将 numeric_expression 小数点左边部分舍入到 length 指定的长度。


length可能不能为0.
[解决办法]
应该是2005的bug!
[解决办法]
sql management 的bug...因为查询分析器可以用...

热点排行