I have been looking for a more efficient way of getting space used requirements for all of my tables in a given database. It seems like Microsoft has answered my prayers. Microsoft has now given us the sp_MSforeachtable stored procedure. This procedure is not currently documented within BOL. The T-SQL script below demonstrates how to use this procedure to retrieve space utilization for all tables within a given database. If you have a better or different way please post and let us know!
CREATE TABLE #TemptableforspaceUsed
EXEC sp_MSforeachtable ‘sp_spaceused ”?”’
set reserved=replace (reserved,’KB’,”)
select top 10 name, reserved
order by convert(bigint,reserved) desc
drop table #TemptableforspaceUsed