SELECT OBJECT_NAME(ID) TABELA, CONVERT(DEC(15),SUM(RESERVED)) RESERVED
INTO #X
FROM SYSINDEXES
WHERE indid in (0, 1, 255)
GROUP BY ID
SELECT TABELA, LTRIM(STR(RESERVED * D.LOW / 1024., 15, 0)) + ' KB'
FROM #X, master.dbo.spt_values d
where d.number = 1
and d.type = 'E'
ORDER BY RESERVED DESC
Fonte: http://blog.leandroribeiro.com/?p=38
Nenhum comentário:
Postar um comentário