mssql 查看数据库中所有表及查看所有列名的方法


sql脚本查看系统所有表的方法

select * from dbo.sysobjects where xtype = 'U'


sql脚本查看系统所有表列名相关信息

 select a.name as [列名],a.length as [列长度],c.name as [列类型],
b.name as [表名] 
from dbo.syscolumns as a
inner join dbo.sysobjects as b on b.id = a.id
inner join dbo.systypes as c on a.xtype = c.xtype
where b.xtype = 'u'