Sunday, July 10, 2016

How to Rename SQL Table Column Name



In our  Timesheet application - in country table - deinfed column name  hoiday_type  defined instead of -Holiday_Type...

Here it is how to correct :

Oracle

To rename  a column in existing oracle  , we can use the below syntx
Again , let us take Scott schema.

In Emp Table if u want to change  Ename to EMP_Name
We use below command
Alter table EMP rename  ename to  EMP_Name


But in SQL 2008 – the  above syntax is not working





The correct  way is ;

SP_RENAME 'TS_METCO_HOLIDAY.metco_hoiday_type' , 'metco_holiday_type', 'COLUMN'

go

No comments:

Post a Comment