Here’s the T-SQL to move a table from one schema to another.
IF OBJECT_ID('dbo.TestTable') IS NOT NULL ALTER SCHEMA TestSchema TRANSFER dbo.TestTable;
In this snippet, we’ll first check to make sure that the table exists before attempting to move it.
This will move TestTable to the TestSchema schema.