Subject Re: [firebird-support] Rename table
Author Lester Caine
David Johnson wrote:

> According to SQL92 specifications ...
>
> create newtable as
> select * from oldtable;
>
> drop oldtable;
>
> But this doesn't seem to work in Firebird. A review of the Interbase
> documentation suggests that there is no direct method. You will need to
> create your new table, migrate your data, and then drop the old table.

The main reason it is not allowed is that unlike the simple SQL92 spec,
we have triggers and stored procedures that may be using the oldtable,
and we have foreign keys that may be linking to it, all of which need to
be managed when changing the name.

Personally I like the security of building a clean new database and
pumping data from the old one. It may take a long time, but it ensures
that there are no problems with any of the data :)

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services