RENAME TABLE

RENAME TABLE — rename a table

Syntax

RENAME TABLE [schema.]old_tablename TO [schema.]new_tablename

Description

Use RENAME TABLE to rename an existing table.

Parameters

old_tablename

Name (optionally schema-qualified) of an existing table to rename.

new_tablename

New table name (optionally schema-qualified) to assign to an existing table.

If provided, schema must be the same for old_tablename and new_tablename. Tables cannot be moved between schemas.

Example

RENAME TABLE table1 TO table2;