---
title: "What is the syntax for renaming a column in an existing table using SQL?"  
description: "What is the syntax for renaming a column in an existing table using SQL?"  
author: "Steilla Mitchel"  
published: 2023-08-30  
updated: 2023-08-31  
canonical: https://www.mindstick.com/forum/159766/what-is-the-syntax-for-renaming-a-column-in-an-existing-table-using-sql  
category: "mssql server"  
tags: ["mssql server", "sql server", "sql"]  
reading_time: 2 minutes  

---

# What is the syntax for renaming a column in an existing table using SQL?

What is the syntax for renaming a [column](https://www.mindstick.com/forum/33860/how-to-calculate-column-summary-in-sql-server) in an [existing table](https://www.mindstick.com/forum/156738/how-to-add-and-remove-columns-from-an-existing-table-in-the-database) using [SQL](https://www.mindstick.com/articles/13115/types-of-keys-in-sql-or-oracle-database)?

## Replies

### Reply by Aryan Kumar

To rename a column in an existing [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) using SQL, you can use the `ALTER TABLE` statement. The syntax for the `ALTER TABLE` statement is:

SQL

```plaintext
ALTER TABLE table_name RENAME COLUMN old_column_name TO new_column_name;
```

The `table_name` is the name of the table that contains the column that you want to rename. The `old_column_name` is the name of the column that you want to rename. The `new_column_name` is the new name for the column.

For example, the following statement will rename the `name` column in the `customers` table to `customer_name`:

SQL

```plaintext
ALTER TABLE customers RENAME COLUMN name TO customer_name;
```

It is important to note that you cannot rename a column that is being used by another object, such as a constraint or a view.

Here are some additional things to keep in mind when renaming a column:

- The `ALTER TABLE` statement is a Transact-SQL statement. Transact-SQL statements are not reversible, so it is important to make sure that you are renaming the correct column.
- You cannot rename a column that is being used by another object, such as a constraint or a view.
- If you are renaming a column that is a primary key or a unique key, you need to update the constraints on any tables that reference the original column.


---

Original Source: https://www.mindstick.com/forum/159766/what-is-the-syntax-for-renaming-a-column-in-an-existing-table-using-sql

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
