---
title: "How to Rename Table Columns in SQL Server?"  
description: "How to Rename Table Columns in SQL Server?"  
author: "Revati S Misra"  
published: 2023-07-11  
updated: 2023-07-12  
canonical: https://www.mindstick.com/forum/159037/how-to-rename-table-columns-in-sql-server  
category: "mssql server"  
tags: ["mssql server", "sql server", "sql"]  
reading_time: 2 minutes  

---

# How to Rename Table Columns in SQL Server?

How to [Rename Table](https://www.mindstick.com/forum/529/rename-table-name-and-column-name-using-sql-query) [Columns in SQL](https://www.mindstick.com/forum/161180/how-to-compare-rows-and-columns-in-sql-server-database) [Server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over)?

## Replies

### Reply by Aryan Kumar

There are two ways to [rename](https://www.mindstick.com/interview/23303/how-to-rename-extention-of-mdf-file) [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) columns in [SQL Server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server):

- **Using the** `sp_rename` **stored procedure**
- **Using the** `ALTER TABLE` **statement**

The `sp_rename` stored procedure is a legacy stored procedure that is still supported in SQL Server. It is a simple way to rename table columns, but it does not allow you to change the data type of the column.

The `ALTER TABLE` statement is a more powerful statement that allows you to rename table columns and change the data type of the column.

Here is an example of how to rename a table column using the `sp_rename` stored procedure:

SQL

```plaintext
EXEC sp_rename 'old_column_name', 'new_column_name', 'COLUMN';
```

This code will rename the `old_column_name` column to `new_column_name`. The `COLUMN` keyword specifies that the column is being renamed.

Here is an example of how to rename a table column using the `ALTER TABLE` statement:

SQL

```plaintext
ALTER TABLE table_name
ALTER COLUMN old_column_name new_column_name [datatype];
```

This code will rename the `old_column_name` column to `new_column_name` and change the data type of the column to `datatype`.

The `ALTER TABLE` statement is the preferred way to rename table columns, because it is more powerful and flexible. However, the `sp_rename` stored procedure can be used if you need to rename a table column without changing the data type of the column.


---

Original Source: https://www.mindstick.com/forum/159037/how-to-rename-table-columns-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
