摘要:
--找出表占据空间最大的create table #t(name varchar(255), rows bigint, reserved varchar(20), data varchar(20), index_size varchar(20), unused varchar(20))exec sp_MSforeachtable "insert into #t exec sp_spaceused '?'" select * from #t order by rows desc;select SUM(Cast(REPLACE(data,' KB' 阅读全文