Categories
Miscellaneous Rdb

RENAME table

From Ian Smith, Rdb Engineering

RENAME TABLE renames the metadata but leaves the old name as a synonym so that triggers, constraints, stored procedures, default, computed by, automatic as, views, etc continue to run. This synonym is required, and should only be deleted if you know there are no dependencies (the simplest of tables). So this is probably not the tool for you.

Instead I’d suggest defining a synonym for use by applications and other definitions. Then you can switch the synonym from one table to the other as required. This scheme works better than views because there is no metadata lock on the synonym name.