13
Jan
2023
2023
How to rename table column in sql server
by Shubham Batra
409
SQL Column Rename
So, in sql server we often have to rename incorrect named columns or old columns. So for that purpose we can use following query.
EXEC sp_rename 'TableName.OldColumnName', 'NewColumnName', 'COLUMN';
In this we have to replace TableName and Oldcolumn name as mentioned and We have to put new column name at the place of "NewColumnName".
So you can modify your table name and column name accordingly and execute the query. After that refresh the database and you will see the new column name updated.
So, This is how to rename column in Sql server.