SQL Rename Column

In SQL Server, there is a standard stored procedure called SP_RENAME to rename the column name. The syntax of this approach is

SP_RENAME '[Table Name].[Old Column Name]', '[New Column Name]', COLUMN'

SQL Rename Column Example

We will alter the name using this SP_RENAME stored procedure in this example. To demonstrate the Rename Column, We use the below table.

Customer Data 1

We use the above-specified Server syntax or stored procedure to rename the YearlyIncome to a new name: Income.

USE NewNameDB
GO

SP_RENAME 'Customers.YearlyIncome', 'Income', 'COLUMN'
SQL Rename Column SP_Rename Syntax 2

See the change

View Table 3

Rename Column using SQL Server Management Studio

If you can access the Management Studio, then right-click on the table, and select the Design from the context menu to change the col name.

Choose Design Option 4

Selecting the Design option will open the table in design mode to rename a column. Let me change the Income to Annual Income

Change the Column name 6

Click the Close button and select the Yes button from the displayed pop-up window to save the changes you made in the design window.

Click Close Button 7

See the changed name.

Select Statement 8
Categories SQL