ALTER TABLE RENAME TO statement in BigQuery

The ALTER TABLE … RENAME TO statement is used to rename an existing table in BigQuery.

Syntax

ALTER TABLE [IF EXISTS] table_name
RENAME TO new_table_name

Arguments

Example: Rename a Table

SQL

-- Rename table bq_cli_table to bq_table
ALTER TABLE IF EXISTS `ashishcoder.bq_cli_dataset.bq_cli_table`
RENAME TO `bq_table`;

Note: The new table name must be unique within the same dataset, and only the table name should be provided—do not include the project or dataset in the RENAME TO clause.