Transfer all tables from a schema to other schema I have two schema. Schema1 and Schema2

How would I transfer all the tables from schema1 to schema2?
Execute this for all of the tables:

alter schema2
transfer schema1.table1;


To programmatically get the statements to execute:

declare
    @SourceSchemaName sysname,
    @DestinationSchemaName sysname,
    @AlterStatements varchar(max);

set @SourceSchemaName = 'NewSchema';
set @DestinationSchemaName = 'HumanResources';
set @AlterStatements = '';

select
    @AlterStatements +=
        'alter schema ' + quotename(@DestinationSchemaName) + 
        ' transfer ' + quotename(schema_name(schema_id)) + '.' + quotename(object_name(object_id)) +
        char(13) + char(10)
from sys.tables
where schema_id = schema_id(@SourceSchemaName);

print @AlterStatements;