![SQL查询数据库中所有表、表字段名及数据类型 SQL查询数据库中所有表、表字段名及数据类型](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
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