Rename Column in SQL Server
There are 2 methods through which we can rename columns of a database in SQL Server which are explained below:
- Using the sp_rename system stored procedure
- Using ALTER statement
Let’s set up an environment
To understand how we can rename columns in SQL Server, we will consider the table Customers as shown below:
CustomerID |
CustomerName |
City |
State |
Age |
---|---|---|---|---|
1 |
Amit Kumar |
Mumbai |
Maharashtra |
28 |
2 |
Kavya Sharma |
Delhi |
Delhi |
35 |
3 |
Amit Singh |
Bangalore |
Karnataka |
42 |
4 |
Rohan Kumar |
Kolkata |
West Bengal |
33 |
Rename Column in SQL Server
SQL Server is a widely used Relational Database Management System (RDBMS) that allows users to create and manage databases effectively. Renaming a column in a database is a common task usually required when users want to change the database schema. In this article, we will explore different methods to rename columns in SQL Server.