一:SQL SERVER 使用以下SQL
declare @table_spaceused table
(name nvarchar(100)
,rows int
,reserved nvarchar(100)
,data nvarchar(100)
,index_size nvarchar(100)
,unused nvarchar(100)
)
insert into @table_spaceused
(name,rows,reserved,data,index_size,unused )
exec sp_MSforeachtable
@command1='exec sp_spaceused ''?'''
select * from @table_spaceused
二:MYSQL 使用以下SQL
use information_schema;
select table_name,table_rows from tables
where TABLE_SCHEMA = 'wyn'
order by table_rows desc;