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
相關文章
相關標籤/搜索