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,

Responses

  1. […] Change Schema Name of Table in MS SQL Server […]

    Like

  2. […] Change Schema Name of Table in MS SQL Server […]

    Like

Leave a reply to Customize Azure Data Studio with Dashboard Widgets – Learn With Sundar Cancel reply