sql server 查询表字段及类型

select b.name as tablename,a.name as columnname,c.name as typename,a.max_length as typelength

from sys.columns a inner join sys.tables b on b.object_id=a.object_id

inner join sys.types c on c.system_type_id=a.system_type_id

where b.name='表名'

order by b.name,a.column_id

posted @ 2018-12-27 17:05  一杯清茶一本书  阅读(7921)  评论(1编辑  收藏  举报