How can we change the name of a column of a table?

Answer Posted / nithya

changing a column name differs from the type of database we use.

MySQL:
ALTER table customer CHANGE Address Addr char(50);

Oracle:
ALTER table customer RENAME COLUMN Address TO Addr;

SQL Server:
It is not possible to rename a column using the ALTER TABLE
statement in SQL Server. Use sp_rename instead.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a query to stop mysql in unix

621


what is the default port for mysql server? : Mysql dba

561


What is ntext?

618


How do I find my mysql username and password?

551


What is different between sql and mysql?

510






Can mysql handle big data?

528


How do I run mysql without installing?

483


How to get last inserted id after insert data from a table in mysql?

549


What is the latest version of mysql?

502


How to Set a root password if there is on root password.

589


I want to start and stop mysql on windows? How do I do that?

523


How do I connect to mysql database?

503


Can I use mariadb instead of mysql?

495


How to create a trigger in mysql?

502


How can I compare two mysql databases?

493