Re: How to delete a column?

From: Anthony Ly <anthony_ly_at_mcimail.com>
Date: 1995/11/14
Message-ID: <48ajh0$cp4_at_news.internetmci.com>#1/1


I know this is very annoying but it also provides another security level for your data just in case you accidentally delete it.

Here is the procedure to delete a column: 1. Make sure nobody using the database
2. Create a new copy of the table (not including the columns you wanna drop)
3. Use an insert statement to migrate data over:

        i.e. INSERT INTO newtable SELECT col1,col2,.... FROM oldtable 4. Rename the old and new versions of the table:

	RENAME oldtable TO oldtabletemporary
	RENAME newtable TO oldtable

5. Grant the same access priviliges for the new version the table that exist for the old version of the table 6. Re-create any views and procedures that depended on the dropped column.
7. Drop the old version of the table when you're sure you got everything
8. Get a beer and bottom up :=)

rlc1_at_ritz.cec.wustl.edu (Robert L Carter) wrote:

>The title says it all...How do I delete a column??
>I can insert ... why can't I remove?
 

>-Rob
Received on Tue Nov 14 1995 - 00:00:00 CET

Original text of this message