现有一字段“金额”数据类型为“decimal”长度为9 但小数位设为了0,我现在想用sql语句更改小数位为2,因为数据库不在本地,只能想这法了,望大虾指点....

解决方案 »

  1.   

    alter table tb alter column 金额 decimal(11,2)
      

  2.   

    alter table tb alter column 金额 decimal(11,2)
      

  3.   

    alter table tt alter column je decimal(11,4)  alter table tt alter column je money  
      

  4.   

    alter table XXX alter column 金额 decimal(11,2)
      

  5.   


    alter table tb alter column 金额 numeric(18,2)
      

  6.   

    参照语法和例子
    http://technet.microsoft.com/zh-cn/library/ms190273(SQL.90).aspxCREATE TABLE dbo.doc_exy (column_a INT ) ;
    GO
    INSERT INTO dbo.doc_exy (column_a) VALUES (10) ;
    GO
    ALTER TABLE dbo.doc_exy ALTER COLUMN column_a DECIMAL (5, 2) ;
    GO
    DROP TABLE dbo.doc_exy ;
    GO