[HELP] Modify a column name that is also a NUPI Index...

Database
Enthusiast

[HELP] Modify a column name that is also a NUPI Index...

It's possible??

I have a column name (ID) that i need to rename in a new name (ID_GEN), and i have tried with this sql statement:

"alter table dbName.tableName rename clumnName as newclumnName"

but i receive the error ("...is an index column and canno be modified")...So i know that it's possible to modify an index only with table empty or with a new creation of table, but i would like to know if ther's a possibility to change only and index column name without using a new creation table...
Waiting for your SKILLED answers...
5 REPLIES
Senior Apprentice

Re: [HELP] Modify a column name that is also a NUPI Index...

"Waiting for your SKILLED answers..."

Ok, there's a skilled "NO, it's not possible" ;-)

Dieter
Enthusiast

Re: [HELP] Modify a column name that is also a NUPI Index...

I often wondered why there was so much fuss about renaming columns when it was part of an index. It didn't seem to me to involve anything more than updating the DBC.TVFields table

(I am often inclined to try this on the Demo, but I shall resist my temptation till I have plentiful time to recover from any unforeseen damages ;-) )

Most of the time the "name change" requests originate from business users, who want to be "correct" about those names. I wouldn't blame them, nevertheless it point's out the importance of restricting user access strictly via views. You can give any name to the column in the view to make user's happy, and you don't have to worry about changing it in the table.

World Peace !
Enthusiast

Re: [HELP] Modify a column name that is also a NUPI Index...

As for rename of attribute or other.
i always think it's application layer's fault.
if we use views right. we should put less care on what
it names, but what it names in view. to access data via view.
not directly by real tables.
Enthusiast

Re: [HELP] Modify a column name that is also a NUPI Index...

But if i'm not DBC and the PRJ asks me to change columnname that is also and index....what i have to do? i could propose a solution with view but the owner of last decision is always my boss-PRJ...so
Teradata Employee

Re: [HELP] Modify a column name that is also a NUPI Index...

Rename the table, then create a simple view with the name the table used to have; GRANT access rights on the view and REVOKE them from the table.

Or create a new table and copy the data...