一个数据库所有的列信息保存在该库syscolumns系统里,使用下面的语句查询
方法一、use 数据库名字
go
Select o.name as 表名, c.name as 列名 ,t.name as 类型, c.length as 长度, c.scale as Scale, c.isnullable as 允许空 from 
syscolumns c, systypes t, sysObjects o 
where c.xtype = t.xusertype and c.id = o.id  and o.xtype='U'   and o.status>0 order by 表名或者
select case when c.colid=1 then object_name(c.id) else '' end as 表名 
,c.name as 字段名
,t.name 数据类型
,c.prec as 长度
,p.value as 字段说明
,m.text as 默认值
from syscolumns c
inner join systypes t on c.xusertype=t.xusertype
left join sysproperties p on c.id=p.id and c.colid = p.smallid
left join syscomments m on c.cdefault=m.id
where objectproperty(c.id,'IsUserTable')=1