how to change a collumn name in sql

Hello developers! In this article I have shared the details about “how to change a collumn name in sql”. Okay, let’s move on to the article.

how to change a collumn name in sql

-- Oracle, MySQL 8+
ALTER TABLE table_name RENAME COLUMN current_name TO new_name;
-- MySQL < 8:
ALTER TABLE table_name CHANGE current_name new_name datatype(length);
-- SQL Server:
EXEC SP_RENAME 'table_name.current_name' , 'new_name', 'COLUMN'
ALTER TABLE `table_name` 
CHANGE `old_name` `new_name` VARCHAR(10) 
CHARACTER SET utf8 
COLLATE utf8_general_ci NULL 
DEFAULT NULL;
ALTER TABLE nom_table
RENAME COLUMN colonne_ancien_nom TO colonne_nouveau_nom

Conclusion

I hope this post helps you to know about “how to change a collumn name in sql”. If you have any doubts regarding this tutorial please let us know via the comment section. Share this tutorial with your friends & family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment