This query will display a list of all tables along with disk sizes and index sizes
SET NOCOUNT ON
DECLARE @cmdstr VARCHAR(100)
CREATE TABLE
CREATE TABLE
SELECT @cmdstr = 'sp_msforeachtable ''sp_spaceused "?"'''
INSERT INTO
INSERT INTO
SELECT
[TABLE_NAME],
ROW_COUNT,
CONVERT(INTEGER, (SUBSTRING(Data_Space_Used,1, len(Data_Space_Used)-3)) / 1024) AS DataMB,
CONVERT(INTEGER, (SUBSTRING(Index_Space_Used,1, len(Index_Space_Used)-3)) / 1024) AS IndexMB,
CONVERT(INTEGER, (SUBSTRING(Table_Size,1, len(Table_Size)-3)) / 1024) AS TotalMB,
CONVERT(INTEGER, (SUBSTRING(Unused_Space,1, len(Unused_Space)-3)) / 1024) AS UnusedMB
FROM
SELECT * FROM
DROP TABLE
DECLARE @table as varchar(150) SET @table = 'dbo.tblROTotal'
SELECT i.name as IndexName, (s.used_page_count * 8) / 2014 as IndexSizeMB
FROM sys.dm_db_partition_stats s JOIN sys.indexes i ON s.[object_id] = i.[object_id] AND s.index_id = i.index_id
WHERE s.[object_id] = object_id(@table)
ORDER BY IndexSizeMB DESC