what is the easiest way to change column name
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


what is the easiest way to change column name... Expand / Collapse
Author
Message
Posted 6/9/2008 5:56:27 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior 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
Post #11779
Posted 6/12/2008 2:46:45 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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.
Post #11832
Posted 6/12/2008 4:05:23 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/25/2008 5:46:43 PM
Posts: 23, Visits: 73
Thank you. That works fine.

Ivy
Post #11834
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 11:18am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 11 queries. Compression Disabled.