SqlServer中获取数据库中每个表的行数
CREATE TABLE #RowCounts(NumberOfRows BIGINT,TableName VARCHAR(128)) EXEC sp_MSForEachTable 'INSERT INTO #RowCounts SELECT COUNT_BIG(*) AS NumberOfRows, ''?'' as TableName FROM ?' SELECT TableName,NumberOfRows FROM #RowCounts ORDER BY NumberOfRows DESC,TableName DROP TABLE #RowCounts
sp_MSForEachTable是SqlServer中没有Document下来的存储过程。
标签:SqlServer,数据库,TableName,NumberOfRows,RowCounts,行数 From: https://www.cnblogs.com/xiangxisheng/p/17756322.html