The RENAME TABLE statement in Teradata renames an existing table in Teradata.
In order to rename an existing table in Teradata, you must have DROP privileges on the table and CREATE TABLE privileges on its containing database or user.
Teradata RENAME TABLE Syntax
The syntax for Teradata RENAME TABLE
is as below.
RENAME TABLE database_name.old_tbl_name to database_name.new_tbl_name;
Here,
- database_name – The name of the database containing the table.
- old_tbl_name – The name of the existing table.
- new_tbl_name – The new name for the table you want to keep.
Teradata RENAME TABLE Example
The following statement renames an existing table name student
to student_details
in the Teradatapoint
database.
RENAME TABLE Teradatapoint.student to Teradatapoint.student_details;