CREATE PROCEDURE sp_totalsize as SELECT o.name 'Table', SUM(c.length) 'Record size', MAX (i.rows) '#of rows', CONVERT (decimal (10, 4), SUM (c.length * i.rows)/(1024.00 * 1024.00)) 'Approx. size (MB)' FROM sysobjects o, syscolumns c, sysindexes i WHERE o.id = c.id AND o.id = i.id AND (i.indid = 1 or i.indid = 0) AND o.type = 'U' GROUP BY o.name COMPUTE SUM (CONVERT (decimal (10,4), SUM (c.length * i.rows)/(1024.00 * 1024.00))) GO