SELECT c.[name] AS schema_name, T.[name] AS table_name, T.[object_id], T.principal_id, T.[schema_id], T.[type], T.type_desc, T.create_date, T.modify_dateFROM sys.tables AS T JOIN sys.schemas AS c ON T.[schema_id] = C.[schema_id]
ALTER SCHEMA Production TRANSFER Purchasing.ProductVendor
select 'alter schema dbo transfer ' + sch.name + '.' + tab.namefrom sys.schemas sch inner join sys.objects tab on sch.schema_id = tab.schema_idwhere sch.name <> 'dbo' and tab.type = 'P'order by tab.name