I need to retrieve the size used of each index used in a table. How can i do? sp_spaceused is not useful, because i need not the sum, but the size of each index.
Thank you very much,
This query can be more useful, the only problem is that i got a -8 result Index_Size_In_KB so for sure there is something wrong, what do you think?
DECLARE @pagesize int
select @pagesize = v.low / 1024 from master..spt_values v where v.number=1 and v.type=N'E'
SELECT o.name TableName, i.name IndexexesName, i.dpages*@pagesize Data_Size_In_KB,(i.used - i.dpages)*@pagesize Index_Size_In_KB, i.reserved*@pagesize Reserved_Size_In_KB
FROM sysobjects o, sysindexes i
WHERE o.id = i.id AND i.indid > 2 AND i.indid < 255 AND o.type = 'U'
ORDER BY o.name
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.