Re: Renaming or Deleting a Column

From: Michael A. Rife <cc920_at_cleveland.Freenet.Edu>
Date: 20 Oct 92 04:39:00 GMT
Message-ID: <1c02h4INN860_at_usenet.INS.CWRU.Edu>


In a previous article, mharper_at_well.sf.ca.us (Michael J. Harper) says:

>Is there any way to change the name of a column in a table on the fly?
>Or to delete a column from a table altogether, again on the fly?
>
>I really need to change the name of a column because I need to create
>a new column with the same name as the "old" column. So, the old column
>needs either to have its name changed or to be deleted altogether.
>
>I welcome any possible comments and solutions, however covert they may be!
>
>Michael J. Harper
>mharper_at_well.sf.ca.us
>

There is no way to just delete a column or rename a column in a table. What you need to do is preserve all the grants and indexes on the table. Next create a new table with the correct table definition and select the data from the old table into the new table. Then drop the old table and rename the new table and regrant access to the table. Received on Tue Oct 20 1992 - 05:39:00 CET

Original text of this message