SqlServer查询数据库表结构查询语句

  select  a.id,b.name as 字段所属表名,a.name as 字段名,c.name 字段属性,d.value 字段说明,a.length 字段长度,a.xscale 字段小数位 
from   syscolumns   a,sysobjects   b,systypes c  
 ,sys.extended_properties d 
 
where   a.id=b.id   and   b.name in(
 
select   name  from   sysobjects   where   xtype='U' )  and  a.xusertype =c.xusertype
 
and a.id=d.major_id and a.colid=d.minor_id
posted @ 2011-08-18 11:53  MrNobody_123456  阅读(179)  评论(0编辑  收藏  举报