CREATE TABLE #RowCountsAndSizes (TableName NVARCHAR(128),rows CHAR(11),
reserved VARCHAR(18),data VARCHAR(18),index_size VARCHAR(18),
unused VARCHAR(18))
EXEC sp_MSForEachTable 'INSERT INTO #RowCountsAndSizes EXEC sp_spaceused ''?'' '
SELECT TableName,CONVERT(bigint,rows) AS NumberOfRows,
(CONVERT(bigint,left(data, len(data)-3))) / 1024 AS 'Size (MB)'
FROM #RowCountsAndSizes
ORDER BY TableName
DROP TABLE #RowCountsAndSizes