Forrest logo
back to the bq tool

bq:tldr:433c6

bq: Copy one table to another.
$ bq cp ${dataset}.${OLD_TABLE} ${dataset}.${new_table}
try on your machine

This command is used to make a copy of a table in BigQuery from one dataset to another.

Here is a breakdown of the different parts of the command:

  • bq: This is the command-line tool for interacting with Google BigQuery.
  • cp: This is the command used to copy a table.
  • ${dataset}.${OLD_TABLE}: This represents the source table that you want to copy. ${dataset} is the name of the source dataset, and ${OLD_TABLE} is the name of the table within that dataset.
  • ${dataset}.${new_table}: This represents the destination for the copied table. ${dataset} is the name of the destination dataset, and ${new_table} is the name you want to give to the copied table.
This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the bq tool