Change Schema Name Of Table In MS SQL Server

Introduction

In this article we will learn the trick to Move a Table from One Schema to Another Schema. Sometimes accidentally we might have given the incorrect name of a schema for the table while creating. But we can move the newly created table from one schema to another schema.

Syntax

ALTER SCHEMA NewSchemaName
TRANSFER OldSchemaName.TableName;

Example

ALTER SCHEMA Details
TRANSFER EmpDetails.Employees

Here Details is my New Schema Name for the table Employees and EmpDetails is the Old Schema Name, once we executed the T-SQL Statement, Details is the Schema for the table Employee.

Conclusion

Thus we can change the table from One Schema to Another Schema, I hope you all found this tip much useful and easy. Please share your feedback in the comment section.

Also Consider to read other articles in SQL Server,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Website Built with WordPress.com.

Up ↑

%d bloggers like this: