CREATE SCHEDULE lets you run SQL automatically on a fixed timetable and save results to a managed table or view.
Automation means BigQuery executes your SQL on a recurring schedule—hourly, daily, or cron-style—without manual clicks, writes results to a target table, and keeps a full history if you choose.
Use CREATE SCHEDULE
for pure-SQL jobs inside BigQuery. Reach for Cloud Scheduler + Cloud Functions only when you need cross-service orchestration, complex branching, or event-driven triggers.
CREATE [OR REPLACE] SCHEDULE schedule_name OPTIONS(...) AS query;
defines the frequency, destination, write mode, partitioning, and notification options in one atomic statement.
1️⃣ Create a dataset analytics
.
2️⃣ Run the statement in the Example section below.
3️⃣ Verify a new schedule under BigQuery > Scheduled Queries.
4️⃣ Observe daily tables like analytics.daily_customer_ltv_20240316
.
Yes—use {run_date}
, {run_time}
, or {run_datetime}
inside destination_table_name_template
to stamp dates on each report.
Keep report SQL deterministic, reference fully-qualified tables, use WRITE_TRUNCATE
for idempotency, and give each schedule a descriptive name (sales_kpi_daily
).
Missing dataset permissions: Ensure the scheduled-query service account has BigQuery Data Editor
on the destination dataset.
Overwriting history: Avoid WRITE_TRUNCATE
when you intend to append. Switch to WRITE_APPEND
or add date partitions.
BigQuery Job History shows each run. Click a failed run to see the error stack. Enable email or Pub/Sub notifications with notification_channel
for proactive alerts.
Use the console’s Edit button to tweak SQL or frequency, or run bq rm --transfer_config
from the CLI to drop it entirely.
All scheduled query executions produce standard BigQuery job logs, accessible in Cloud Logging under resource.type="bigquery_project"
.
See the FAQ section below for quick answers on cost, limits, and parameter support.
No. You pay the same on-demand or flat-rate query cost; automation itself is free.
Each project can have up to 1000 schedules and each schedule must run at least every 15 minutes.
You can reference {run_date}
, {run_time}
, and {run_datetime}
in SQL via @run_date
-style named parameters.