创建表
  CREATE TABLE aaa
        (a numeric(5,1) NOT NULL)   如何用程序获得字段a 的宽度(5)和精度(1)

解决方案 »

  1.   

    //得到表中所有字段的类型、精度和小数位数select sysobjects.name as 表名,syscolumns.name as 列名,systypes.name as 类型,
    syscolumns.length as 长度,syscolumns.xprec as 精度,syscolumns.xscale as 小数位数 
    from sysobjects,syscolumns,systypes
    where sysobjects.id =syscolumns.id and sysobjects.name='表名' 
    and systypes.xtype=syscolumns.xtype