|
|
|
Junior Member
      
Group: Forum Members
Last Login: 8/25/2008 5:46:43 PM
Posts: 23,
Visits: 73
|
|
If i want to change column name from 'ABC' to 'ABCD', what is the easiest way to do it. and if the column is one of the primary index, how could i do it?
Ivy
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Yesterday @ 6:53:58 PM
Posts: 425,
Visits: 401
|
|
you can do an
ALTER TABLE mytbl RENAME COLUMN oldnme TO newnme;
However there are restrictions, like you can't rename a column if it's part of an index (for PI you will have to drop and recreate the table, for SI, drop indexes and then rename, create the SI again ...)
For the complete list of restrictions, lookup the "Renaming Table Columns" section in data definitions manual.
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 8/25/2008 5:46:43 PM
Posts: 23,
Visits: 73
|
|
Thank you. That works fine.
Ivy
|
|
|
|