MSSql Rename table schema SQL Tutorial

First, create the new schema name to which you will transfer. Execute the command below, copy the result into a new query window and execute it.





--Rename the schema for a set of tables
SELECT 'ALTER SCHEMA TRNCTL TRANSFER ' + s.Name + '.' + p.Name FROM
sys.Tables p INNER JOIN sys.Schemas s on p.schema_id = s.schema_id
where s.Name = 'your_schema_name'