sqlserver查询用户表和对应的表结构

查询用户表

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

查询表结构:

          select a.name as colName,a.length,c.name as type,b.name as tableName 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'

猜你喜欢

转载自cwd306972384.iteye.com/blog/1779887