sqlerver 表大小分析

IF OBJECT_ID('tempdb..#TB_TEMP_SPACE') IS NOT NULL DROP TABLE #TB_TEMP_SPACE
GO
CREATE TABLE #TB_TEMP_SPACE(
NAME VARCHAR(500)
,ROWS INT
,RESERVED VARCHAR(50)
,DATA VARCHAR(50)
,INDEX_SIZE VARCHAR(50)
,UNUSED VARCHAR(50)
)
GO
SP_MSFOREACHTABLE 'INSERT INTO #TB_TEMP_SPACE exec sp_spaceused ''?'''
GO
SELECT *
FROM #TB_TEMP_SPACE
ORDER BY REPLACE(DATA,'KB','')+0 DESC
GO

未经允许不得转载:lxfamn » sqlerver 表大小分析

赞 (0) 打赏

置顶推荐

评论 0

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏