Skip to content

SQL Changing Schema Name

Changing it one by one use the following.

ALTER SCHEMA dbo TRANSFER someschema.someobject;

Changing all stored procedures.

select 'ALTER SCHEMA dbo TRANSFER ' + SPECIFIC_SCHEMA + '.' + ROUTINE_NAME from INFORMATION_SCHEMA.ROUTINES  
where ROUTINE_TYPE='procedure'

 

Published inSQL

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *