All Forums Database
karmakoma 9 posts Joined 12/06
21 Jun 2007
[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 (" 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...

dnoeth 4628 posts Joined 11/04
21 Jun 2007

"Waiting for your SKILLED answers..."Ok, there's a skilled "NO, it's not possible" ;-)Dieter


joedsilva 505 posts Joined 07/05
22 Jun 2007

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 !

Luckyhansh 30 posts Joined 08/06
25 Jun 2007

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 whatit names, but what it names in view. to access data via view.not directly by real tables.

karmakoma 9 posts Joined 12/06
18 Jul 2007

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

Fred 1096 posts Joined 08/04
18 Jul 2007

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...

You must sign in to leave a comment.