Changing Column Name of MS SQL Table with Query

In MS SQL Server, the following procedure is followed to change the column name of a table with a query.

EXEC sp_rename {Table Name}.{Old Column Name} , {New Column Name}, 'COLUMN'

An example usage is as follows..

EXEC sp_rename 'Customers.Name' , 'NewName', 'COLUMN'

Note : When the related query is run, it is seen that the column name does not change in the left panel (Object Explorer). For this, the Columns folder in the detail of the table must be Refreshed.



You May Interest

What Have INCLUDED Columns With SQL Server Indexes ?

What are The Different Backup Options With SQL Server ?

Getting List of All Stored Procedures in Database in MS SQL

Getting List of MS SQL User-Created Tables

What is the Maximum Number of Columns a Table in SQL Server ?