发布网友 发布时间:2022-04-30 19:31
共3个回答
懂视网 时间:2022-04-30 23:52
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中获取数据库中每个表的行数
标签:
热心网友 时间:2022-04-30 21:00
执行一下就可以了热心网友 时间:2022-04-30 22:18
select * from sysobjects where xtype = 'U'