【Sql】查询数据库表详细信息

2018-06-16  本文已影响0人  KevinTseng
SELECT a.name as '字段名',c.name '类型',sm.text as '默认值',a.isnullable as '是否为空', 
a.length as '长度',a.xscale as '小数位数',e.value as '字段说明' 
FROM syscolumns a  
left join systypes b on a.xusertype=b.xusertype  
left join systypes c on a.xtype = c.xusertype  
inner join sysobjects d on a.id=d.id and d.xtype='U'  
left join syscomments sm on a.cdefault=sm.id  
left join sys.extended_properties e on a.id = e.major_id and a.colid = e.minor_id and  
e.name='MS_Description' where d.name='category'
上一篇 下一篇

猜你喜欢

热点阅读