Syntax:
The syntax of the sp_rename stored procedure is:
Rename a Column in SQL Server
For example, I have a table named Accounts in the MSSQL server database. This table contains a column named “cust_id”. For some reason, we need to rename this column to “customer_id”. See below screenshot:
Open query windows and execute the following query. Here Test_dbis the database name. This may show you a warning message with the result, But this will rename the column name successfully. Checked the table structure again, and I found that the column is updated as required.
Conclusion
This tutorial helped you to rename a table column name in the SQL Server database.