如:select CONVERT(numeric(13,12),1/0.691),结果是1.447178000000只能保存6位小数。。不是怎么更改默认的最大小数位数。

解决方案 »

  1.   

    select CONVERT(numeric(13,12),1.000000000000/0.691)
                    
    --------------- 
    1.447178002894(所影响的行数为 1 行)
      

  2.   

    select CONVERT(numeric(13,12),1.000000000000/0.691)
                    
    --------------- 
    1.447178002894(所影响的行数为 1 行)
      

  3.   

    select cast(1 as dec(18,12))/0.691
    ---------------------------------------
    1.4471780028943560(1 行受影响)
      

  4.   

    alter table tb alter column  colname decimal(38,12)
      

  5.   

    alter table tb alter column  colname decimal(38,12)
      

  6.   

    這樣改就可以了
    select CONVERT(decimal(13,12),1/0.691000000000)
    結果:1.447178002894