How to Rename Table in SQL Server with an example?. To demonstrate the Rename Table name, we use the below-shown Customer table.
SQL Rename Table Name Example
There is a stored procedure called SP_RENAME to rename the table name. In this example, we will rename the Customer table using this sp. The syntax to rename table name using sp_rename
-- Syntax for SQL Server rename table Name is: SP_RENAME '[Old Table Name]', '[New Table Name]'
We use the above sp_rename syntax to rename the Customers table to NewCustomers
Rename Table using SSMS
Rename Table Name Approach 2
To rename a table in SQL Server, 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.
We are changing the table name to Customers and you can see the new table name.