Renaming a table

By: Ben Matterson

Abstract: How can I rename a table in my database?

Problem

I have a table in the database named TABLE_ONE. This table contains data. Is it possible to rename this table to TABLE_TWO? Can I do this via SQL?

Solution

No, you cannot simply rename the table, nor can you rename it using SQL. You must create a new table with the name you desire and then transfer the data from TABLE_ONE to TABLE_TWO. This part is fairly straightforward. The tedious part will be recreating any and all domains, constraints, triggers, stored procedures, etc, etc. for TABLE_TWO.

Server Response from: ETNASC04