use test -- 查询数据库中所有的表和架构名称select SCHEMA_NAME(schema_id) as table_schema_name, name as table_name from sys.tables; select table_schema,table_name from INFORMATION_SCHEMA.TABLES where TABLE_TYPE=N'base table' -- 查看表列信息 select name as column_name,TYPE_…
方法一: SELECT a.name,b.rows FROM sysobjects a INNER JOIN sysindexes b ON a.id=b.id ,) AND a.Type='u' ORDER BY b.rows desc 方法二: ), RowCnt INT) EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?' select * from #temp order by RowCnt d…