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
虽然很简单,但发表出来,希望能帮助初学的朋友,只要细心研究syscolumns,systypes...等系统表,就可以得到你所想要的信息!
本文地址:http://com.8s8s.com/it/it20447.htm