Stay organized with collections
Save and categorize content based on your preferences.
The DROP MODEL statement
To delete a model in BigQuery ML, use the DROP MODEL or the DROP
MODEL IF EXISTS DDL statement.
The DROP MODEL DDL statement deletes a model in the specified dataset. If
the model name does not exist in the dataset, the following error is returned:
Error: Not found: Model myproject:mydataset.mymodel
The DROP MODEL IF EXISTS DDL statement deletes a model in the specified
dataset only if the model exists. If the model name does not exist in the
dataset, no error is returned, and no action is taken.
If you are deleting a model in another project, you must specify the project,
dataset, and model in the following format: `[PROJECT].[DATASET].[MODEL]`
(including the backticks); for example, `myproject.mydataset.mymodel`.
For information about the supported model types of each SQL statement and function,
and all of the supported SQL statements and functions for each model type, read the
End-to-end user journey for each model.
Syntax
{DROP MODEL | DROP MODEL IF EXISTS}
model_name
Where:
{DROP MODEL | DROP MODEL IF EXISTS} is one of the following statements:
DROP MODEL — deletes a model in the specified dataset
DROP MODEL IF EXISTS — deletes a model only if the model exists in the
specified dataset
model_name is the name of the model you're deleting.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eDROP MODEL\u003c/code\u003e deletes a specified model from a dataset, returning an error if the model does not exist.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDROP MODEL IF EXISTS\u003c/code\u003e deletes a model only if it exists, without returning an error if the model is not found.\u003c/p\u003e\n"],["\u003cp\u003eTo delete a model in a different project, specify the model name with project and dataset in the format \u003ccode\u003e[PROJECT].[DATASET].[MODEL]\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe syntax for the statements uses the keyword either \u003ccode\u003eDROP MODEL\u003c/code\u003e or \u003ccode\u003eDROP MODEL IF EXISTS\u003c/code\u003e followed by the model's name.\u003c/p\u003e\n"]]],[],null,["# The DROP MODEL statement\n========================\n\nTo delete a model in BigQuery ML, use the `DROP MODEL` or the `DROP\nMODEL IF EXISTS` DDL statement.\n\nThe `DROP MODEL` DDL statement deletes a model in the specified dataset. If\nthe model name does not exist in the dataset, the following error is returned:\n\n`Error: Not found: Model myproject:mydataset.mymodel`\n\nThe `DROP MODEL IF EXISTS` DDL statement deletes a model in the specified\ndataset only if the model exists. If the model name does not exist in the\ndataset, no error is returned, and no action is taken.\n\nIf you are deleting a model in another project, you must specify the project,\ndataset, and model in the following format: \\`\\[PROJECT\\].\\[DATASET\\].\\[MODEL\\]\\`\n(including the backticks); for example, \\`myproject.mydataset.mymodel\\`.\n\nFor information about the supported model types of each SQL statement and function,\nand all of the supported SQL statements and functions for each model type, read the\n[End-to-end user journey for each model](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-e2e-journey).\n\nSyntax\n------\n\n```\n{DROP MODEL | DROP MODEL IF EXISTS}\nmodel_name\n```\n\nWhere:\n\n**`{DROP MODEL | DROP MODEL IF EXISTS}`** is one of the following statements:\n\n- `DROP MODEL` --- deletes a model in the specified dataset\n- `DROP MODEL IF EXISTS` --- deletes a model only if the model exists in the specified dataset\n\n**`model_name`** is the name of the model you're deleting."]]