I need to get a sum of the size of a certain set of tables in megabytes. I know I can use sp_spaceused, and use a cursor to loop through the tables, but the results comes back something like '2046 KB'.
I guess I could use substring and patindex to strip off the 'KB' and then convert the varchar to a number, but if anyone else has a good way to get the total sum of bytes for a list of tables I would like to see it.
Thanks,
Keith