In this article, we will show you, How to Rename Table in SQL Server with an example. To demonstrate the SQL Rename Table name, We are going to use the below-shown Customers table.
SQL Rename Table Name Example
In SQL, there is a stored procedure called SP_RENAME to rename SQL Server Table name. In this example, we will rename the Customers table using this sp.
Syntax behind this approach is as shown below:
-- Syntax for SQL Server rename table Name is: SP_RENAME '[Old Table Name]', '[New Table Name]'
We are going to use above specified syntax to rename the Customers table to NewCustomers
SQL Server Rename Table using SSMS
If you can access SQL Management Studio then you can follow below-shown steps to change the table name. Double-click on the Table allows you to change the table name.
Let me change the table name to CustomersTable
You can see the changed table name
Rename Table in SQL Server – Approach 2
Right-click on the Table, and select the Rename from the context menu.
Change as per your requirement. For now, we are changing the name to Customers
From the below screenshot, you can see the new name