Home » Bigquery » Tutorials » Alter view set options

BigQuery Alter view set options

Changes the view options

Alter view set options example

Create a view that expires in 7 days

\n
\nALTER VIEW mydataset.myview\nSET OPTIONS (\n  expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY),\n  description="View that expires seven days from now"\n)\n

Explanation

view_set_options_list:

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NAMEVALUEExplanation
expiration_timestampTIMESTAMP\n Example: expiration_timestamp=TIMESTAMP "2025-01-01 00:00:00 UTC"\n This property is equivalent to the expirationTime table resource property.\n
friendly_name\n STRING\n \n Example: friendly_name="my_view"\n This property is equivalent to the friendlyName table resource property.\n
description\n STRING\n \n Example: description="a view that expires in 2025"\n This property is equivalent to the description table resource property.\n
labels\n ARRAY>\n \n Example: labels=[("org_unit", "development")]\n This property is equivalent to the labels table resource property.\n

Syntax reference

ALTER VIEW [IF EXISTS] view_name\nSET OPTIONS(view_set_options_list)