Home » Bigquery » Tutorials » Alter table rename

BigQuery Alter table rename

To rename a table to a different name, us the Alter table rename command

Alter table rename example

ALTER TABLE mydataset.mytable RENAME TO mynewtable

Explanation

  • While renaming a table, make sure the new table name is not already taken.
  • If there are dependent objects like views or stored procedures on the table, make sure to modify the table name in there as well

Syntax reference

ALTER TABLE [IF EXISTS] [[project_name.]dataset_name.]table_name
RENAME TO new_table_name