Renaming Tables






Renaming Tables

The RENAME TABLE statement gives an existing table a new name.

Rename table statement> ::=
   RENAME TABLE <table name change>

<table name change> ::= <table name> TO <table name>


Figure. Change the name of the PLAYERS table to TENNIS_PLAYERS.

RENAME TABLE PLAYERS TO TENNIS_PLAYERS

All other database objects that refer to this table are changed accordingly. Assigned privileges do not disappear, foreign keys remain, and views that use this renamed table keep on working.

Portability

Most SQL products support the RENAME TABLE statement, but still not all.




 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows