In this article, we will show you, How to Rename Table in SQL Server with an example.
To demonstrate the Sql Server 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 Table name. In this example, we will rename the Customers table using this sp.
The 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 Management Studio then you can follow below-shown steps to change the table name. Double-click on the Table allows you to Remname table name.
Let me change the table name to CustomersTable
You can see the changed table name
Sql Server Rename Table – Approach 2
In order to rename table, Within the Object explorer, Go to the Database where the table exists. Next, Right-click on the Table, and select the Rename from the context menu.
Please change the table name as per your requirement. For now, we are changing the table name to Customers
From the below screenshot, you can see the new table name
Thank You for Visiting Our Blog