In this article, we will show you, How to Rename Table Name in SQL Server with 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 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
SQL Server Rename Table Name 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 as Customers
From the below screenshot,. you can see the new name