BigQuery: Duplicate a Table
Sometimes it's useful to copy a table.
You can't directly copy tables via a SQL command in BigQuery, so we'll walk through alternative methods.
In the BigQuery UI, select the table you wish to copy, then push the Copy Table
button. Enter the desired new table name.
Or you can copy a table in the BigQuery command line tool:
bq cp mydataset.mytable mydataset2.mytable2
BigQuery documentation lists additional methods for copying a table (via API, with Python, PHP, etc).
🤓 Fun fact: copying a table is a key step in "renaming" a table in BigQuery, as there is no method for direct renaming in BigQuery.
Previous
How to Add a ColumnFinally, a unified workspace for your SQL development
Get more done, together, with PopSQL and BigQuery