CREATE TABLE #DiskUpsageByTables ( name NVARCHAR(128), rows CHAR(11), reserved VARCHAR(18), data VARCHAR(18), index_size VARCHAR(18), unused VARCHAR(18) ); INSERT INTO #DiskUpsageByTables EXEC sp_MSforeachtable 'sp_spaceused ''?'''; SELECT * FROM #DiskUpsageByTables ORDER BY CAST(REPLACE(reserved, ' KB', '') AS INT) DESC; DROP TABLE #DiskUpsageByTables;