This works great... thanks for posting it. The only difference that I had to make was to add the table_schema to the cursor.
DECLARE PKMS_Tables CURSOR LOCAL FOR
select (table_schema + ''.'' + table_name) as table_name from information_schema.tables
where table_type = ''base table'' order by 1
I have tables that are not dbo.