round函数。。select round(0.6)select round(9.6)报错!!An error occurred while executing batch. Error message is: Arithmetic Overflow.大虾们又没有碰到过?难道是2005的bug?好像2000不会报错。。

解决方案 »

  1.   

    错了,是
    select round(0.6,0)select round(9.6,0)这样。。
      

  2.   

    在线等!就是研究一下。。找到其他方法了2005 专成numeric会自动四舍五入的好像!
      

  3.   

    试过了,确实如此
    2000和2005一样,都出错
    应该是bug吧
      

  4.   

    试过了,确实如此
    在2005的managementstudio中连接2000和2005进行查询,结果一样,都出错
    应该是bug吧在2000的查询分析器中连接2000和2005进行查询,结果一样,都不出错
      

  5.   

    我在数据库执行select round(9.6,0),报了一个好像是溢出的错误,不可以这样写么?
      

  6.   

    看了一下,在SQL2000里面没事(我的是打了补丁sp4),在2005中不行(打了补丁sp2)!
      

  7.   

    应该处在 length 的问题.numeric_expression 的舍入精度。length 必须是 tinyint、smallint 或 int。如果 length 为正数,则将 numeric_expression 舍入到 length 指定的小数位数。如果 length 为负数,则将 numeric_expression 小数点左边部分舍入到 length 指定的长度。
    length可能不能为0.
      

  8.   

    sql management 的bug...因为查询分析器可以用...
      

  9.   

    哈哈。。sql management 的bug。强。。结贴谢谢各位捧场