SELECT   a.表名,a.字段名,a.类型和长度,a.可否为空,b.text   as   默认值   from
(select   A.name   as   表名,b.name   as   字段名,c.name+ '( '+cast(b.length   as   varchar)+ ') '   as   类型和长度,b.isnullable   as   可否未空,B.cdefault
from   sysobjects     A   ,syscolumns   B,systypes   C
where   A.xtype= 'u '   and   a.id=b.id   and   B.xusertype=c.xusertype
)   a   left   join   syscomments   B   on   a.cdefault=b.id
order   by   A.表名
posted on 2011-09-02 21:39  135  阅读(140)  评论(0编辑  收藏  举报