当前位置: 数据库>sqlserver
sql 查询所有数据库、表名、表字段的代码
来源: 互联网 发布时间:2014-08-29
本文导语: 1、查询所有表 select [id], [name] from [sysobjects] where [type] = 'u' order by [name] 2、查询所有数据库 select [name] from [sysdatabases] order by [name] 3、查询表中字段 select [name] from [syscolumns] where [name] = 'tableXXX'order by [colid]
1、查询所有表
select [id], [name] from [sysobjects] where [type] = 'u' order by [name]
2、查询所有数据库
select [name] from [sysdatabases] order by [name]
3、查询表中字段
select [name] from [syscolumns] where [name] = 'tableXXX'order by [colid]