当前位置: 代码迷 >> SQL >> sqlserver查询用户表跟对应的表结构
  详细解决方案

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

热度:49   发布时间:2016-05-05 12:28:18.0
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'

  相关解决方案