• To get the scrip to work with AdventureWorks2008R2 I changed the insert into @v_Table to:

    Insert Into @v_Table

    Select Table_Schema + '.' + Table_Name From Information_Schema.Tables Where Table_Type = 'BASE TABLE'

    Unfortunatley sp_spaceused doesn't return the schema!