SQL查询数据库中所有表、表字段名及数据类型

select b.name,a.colid,a.name
,(select systypes.name+'('+cast(a.length/2as varchar(10))+')' from systypes where a.xusertype=systypes.xusertype ) type
fromsyscolumns a
left outer join sysobjects b
on a.id=b.id
where b.xtype='U'and b.name = 'hq_hotel'
order by b.name,a.colid

 

posted @ 2019-10-09 21:57  沙耶  阅读(1149)  评论(0编辑  收藏  举报