Home » Bigquery » Tutorials » Alter table drop column

BigQuery Alter table drop column

To remove one or more columns from an existing table schema, use the Alter table drop column command

Alter table drop column example

    ALTER TABLE mydataset.mytable
      DROP COLUMN A;

Dropping multiple columns

    ALTER TABLE mydataset.mytable
      DROP COLUMN A,
      DROP COLUMN IF EXISTS B

Explanation

  • If there are dependent objects like views or stored procedures on the table, make sure to modify to remove the column references

Syntax reference

ALTER TABLE [[project_name.]dataset_name.]table_name
DROP COLUMN [IF EXISTS] column_name [, ...]