您现在的位置是:首页 > SQL > 查询sql server和mysql数据库中所有表的数据条数

查询sql server和mysql数据库中所有表的数据条数

王递杰 2023年7月7日 SQL

SQL Server查询语句:

select schema_name(t.schema_id) as [Schema], t.name as TableName,i.rows as RowNumber
from sys.tables as t, sysindexes as i
where t.object_id = i.id and i.indid <=1
order by RowNumber desc

MYSQL查询语句:

SELECT TABLE_NAME,TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_SCHEMA = '库名' 
ORDER BY TABLE_ROWS DESC



评论

暂无评论