SqlServer数据文件增长也很快,到底是哪些表增长造成的呢?
时间:2021-07-01 10:21:17
帮助过:2人阅读
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 SUBSTRING(t.reserved,
0,
CHARINDEX(
‘KB‘, t.reserved)
-1),
*
from #t t
order by cast(
SUBSTRING(t.reserved,
0,
CHARINDEX(
‘KB‘, t.reserved)
-1)
as int)
desc
drop table #t
SqlServer数据文件增长也很快,到底是哪些表增长造成的呢?
标签: