MS Sql Server 查询数据库中所有表数据量

方法一:

SELECT a.name,b.rows FROM sysobjects a
INNER JOIN sysindexes b ON a.id=b.id
WHERE b.indid IN(0,1) AND a.Type='u'
ORDER BY b.rows desc

方法二:

CREATE TABLE #temp (TableName VARCHAR (255), RowCnt INT)
EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?' select * from #temp order by RowCnt desc
DROP TABLE #temp
上一篇:PyInstaller安装使用方法


下一篇:web自动化测试---css方式定位页面元素