Tag Archives: rename table

Rename table and column name for Oracle, SQL Server, Mysql & POSTGRESQL

Rename table and column name for Oracle, SQL Server, Mysql & POSTGRESQL

Following command for rename the Table Name

SQL Server

EXEC sp_rename 'oldtablename', 'newtablename';

Oracle

alter table tablename rename to  newtablename;

MYSQL

RENAME TABLE table_name TO new_table_name;

POSTGRESQL

ALTER TABLE table_name RENAME TO newtablename;

Following command for Rename Column Name in table

SQL Server

EXEC sp_RENAME 'TableName.OldColumnName' , 'NewColumnName', 'COLUMN'

Oracle

alter table tablename columname rename to newcolumname

MYSQL

alter table change oldcoumnname newcoklumnaate

POSTGRESQL

ALTER TABLE table_name RENAME COLUMN column_name TO new_column_name;

Advertisements