Re: How to rename a table ?

From: Mike Frost <mfrost_at_email.usps.gov>
Date: 1996/12/27
Message-ID: <32C3DDC6.7548_at_email.usps.gov>#1/1


Atif Ahmad Khan wrote:
>
> I have a table that is serving data to web users around the clock.
> Its a rather huge table, has a primary key and a couple of indices also.
>
> I figured that instead of trying to update 5,000 rows in the main
> 200,000 rows table, I may be better off doing it all to a temporary
> table while dropping its indices to improve performance and when I am
> done, drop the main table and rename the temporary table as the main table.
>
> Is this possible ? Also is this a good solution ? I looked up the alter
> table command in the SQL Reference manual and did not find a way to rename
> a table.
>
> Thanks in advance for any pointers.
>
> Atif Khan
> aak2_at_ra.msstate.edu

You can rename a table using the RENAME command (syntax: RENAME <old table name> TO <new table name>.
However, when you drop your main table all object privileges (i.e., SELECT, UPDATE, DELETE) to that table are also dropped and will have to be reassigned even if the new table has the same name as the old table. Received on Fri Dec 27 1996 - 00:00:00 CET

Original text of this message