Re: [Q]: Renaming columns in a table ?

From: Chuck Hamilton <chuckh_at_ix.netcom.com>
Date: 1995/06/26
Message-ID: <3sme2j$jin_at_ixnews5.ix.netcom.com>#1/1


In <3skisf$36e_at_scsing.switch.ch> MHEJTMANEK_at_clients.switch.ch (MICHAEL HEJTMANEK) writes:
>
>In <3skdqh$mtb_at_ixnews4.ix.netcom.com> rsingh_at_ix.netcom.com writes:
>
>>
>>
>> Is is possible to rename a column in a table ?
>>
>> Thanks in advance.
>
>
>
>No. You need t get the data out. Drop the table. Rebuild the table
>(with new col names) and then put the data back in.
>
>P.S.
>You may get answers that say yes because it is possible to screw with
>the internals and change column names. Do not do this!

One other option is to rename the table and then create a view on it using the old table's name as the view name. When you create the view, use a column name alias for the one that you want to change.

From what I understand, a lot of shops do this anyway as a means of controlling table access. That is... never giving anyone access to any actual tables, just to the views created on the tables.

-- 
Chuck Hamilton
chuckh_at_ix.netcom.com

Never share a foxhole with anyone braver than yourself!
Received on Mon Jun 26 1995 - 00:00:00 CEST

Original text of this message