[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eSaved queries in BigQuery allow users to create and manage SQL scripts, enhancing collaboration through options like sharing and version history.\u003c/p\u003e\n"],["\u003cp\u003eThese queries, which are code assets within BigQuery Studio and powered by Dataform, save both the query text and settings, and are stored in a default region that can be updated.\u003c/p\u003e\n"],["\u003cp\u003eAccess to saved queries is controlled using Identity and Access Management (IAM) roles, and they are only available in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eClassic saved queries, which are an earlier version of the feature, will be fully replaced by BigQuery Studio saved queries in the future, and are deprecated.\u003c/p\u003e\n"],["\u003cp\u003eThe migration from classic saved queries to BigQuery Studio saved queries is recommended to leverage the latest features and will be needed in the future due to deprecation.\u003c/p\u003e\n"]]],[],null,["# Introduction to saved queries\n=============================\n\nThis document provides an introduction to saved queries in BigQuery.\nYou can use saved queries to create and manage SQL scripts. Changes to a saved\nquery are automatically saved so that you don't lose your work when you close\nthe query editor.\nSaved queries improve collaboration and query management with the following\noptions:\n\n- [Share saved queries](/bigquery/docs/work-with-saved-queries#share-saved-query) with specific users and groups by using Identity and Access Management (IAM).\n- Review the query version history.\n- Revert to or branch from previous versions of the query.\n\nSaved queries are\n[BigQuery Studio](/bigquery/docs/query-overview#bigquery-studio)\ncode assets powered by [Dataform](/dataform/docs/overview).\n[Notebooks](/bigquery/docs/notebooks-introduction) are also code assets. All\ncode assets are stored in a default\n[region](#supported_regions). Updating the default region changes\nthe region for all code assets created after that point.\n\nSaved query capabilities are available only in the Google Cloud console.\n\n### Saved query security\n\nYou control access to saved queries by using Identity and Access Management (IAM) roles.\nFor more information, see\n[Share saved queries](/bigquery/docs/work-with-saved-queries#share-saved-query).\n\n### Supported regions\n\nBigQuery Studio lets you save, share, and manage saved queries. The\nfollowing table lists the regions where BigQuery Studio is available:\n\n### Quotas and limits\n\nFor more information, see\n[Saved query quotas and limits](/bigquery/quotas#saved_query_limits).\n\n### Limitations\n\nSaved queries have the following limitations:\n\n- You can [grant public access to saved queries](/bigquery/docs/manage-saved-queries#grant-public-access) only to the [`allAuthenticatedUsers`](/iam/docs/principals-overview#all-authenticated-users) principal. You can't grant access to saved queries to the [`allUsers`](/iam/docs/principals-overview#all-users) principal.\n- If your Google Cloud project contains more than 2500 classic saved queries, you can't use [batch migration](/bigquery/docs/manage-saved-queries#migrate_classic_saved_queries) to migrate classic saved queries to saved queries.\n\nClassic saved queries\n---------------------\n\n| **Deprecated:** Saved queries, available in [BigQuery Studio](/bigquery/docs/enable-assets), will fully replace classic saved queries in the future. The deprecation timeline is being reviewed. For more information, see [Deprecation of classic saved queries](/bigquery/docs/saved-queries-introduction#classic-saved-queries-deprecation). To learn how to migrate to saved queries, see [Migrate classic saved queries](/bigquery/docs/manage-saved-queries#migrate_classic_saved_queries).\n\nClassic saved queries are an earlier way of saving and sharing SQL queries.\nClassic saved queries provide the query text, and the only query setting\nretained by a classic saved query is the SQL version. This setting\ngoverns whether the query uses legacy SQL or GoogleSQL. To\nquery the data, users must have access to the data that the saved query\naccesses.\n\nYou can see classic saved queries in the **(Classic) Queries** folder of the\n**Explorer** pane:\n\n| **Note:** If you have not enabled BigQuery Studio, classic saved queries appear in the **Saved queries (\u003cvar translate=\"no\"\u003eNUMBER\u003c/var\u003e)** folder of the **Explorer** pane instead of the **(Classic) Queries** folder.\n\nThere are 3 types of classic saved queries:\n\n- **Personal.** Personal classic saved queries are visible only to the user who creates them. They are identified with the person icon.\n- **Project-level.** Project-level saved queries are visible to principals that have the required [permissions](/bigquery/docs/work-with-saved-queries#required_permissions_for_classic_saved_queries). They are identified with the people icon.\n- **Public.** Public classic saved queries are visible to anyone with a link to the query. They are identified with the share icon.\n\nYou can\n[migrate](/bigquery/docs/manage-saved-queries#migrate_classic_saved_queries)\nclassic saved queries to saved queries to take advantage of the new\ncapabilities, or\n[continue to maintain them](/bigquery/docs/work-with-saved-queries#update_classic_saved_queries)\nas classic saved queries until deprecation. The timeline for deprecation is being reviewed.\n\nThe classic saved query feature is available only in the\nGoogle Cloud console.\n\nDeprecation of classic saved queries\n------------------------------------\n\nThe saved queries feature of\n[BigQuery Studio](/bigquery/docs/enable-assets)\nwill replace classic saved queries. The deprecation timeline is being reviewed. To edit existing classic saved queries\nafter deprecation, you must\n[migrate classic queries](/bigquery/docs/manage-saved-queries#migrate_classic_saved_queries)\nto BigQuery Studio saved queries.\n\nIf users, including yourself, have personal queries with\ninformation that shouldn't be made available to others with access to data in\nthe project, then the query's owner must delete the queries or the information\nbefore completing the migration.\n\nTo support this transition, the following BigQuery IAM\nroles were updated in February 2024:\n\n- **[BigQuery Admin (`roles/bigquery.admin`)](/iam/docs/understanding-roles#bigquery.admin)**\n will get\n [Dataform Admin (`roles/dataform.admin`)](/iam/docs/understanding-roles#dataform.admin)\n permissions.\n\n- **[BigQuery Job User (`roles/bigquery.jobUser`)](/iam/docs/understanding-roles#bigquery.jobUser)**\n will get the following permissions:\n\n - `dataform.locations.get`\n - `dataform.locations.list`\n - `dataform.repositories.create`\n - `dataform.repositories.list`\n- **[BigQuery User (`roles/bigquery.user`)](/iam/docs/understanding-roles#bigquery.user)**\n will get the following permissions:\n\n - `dataform.locations.get`\n - `dataform.locations.list`\n - `dataform.repositories.create`\n - `dataform.repositories.list`\n\nTo let users without the BigQuery Admin, BigQuery Job User, or BigQuery User\nroles use saved queries, grant them\nthe [required permissions](/bigquery/docs/work-with-saved-queries#required_permissions)\nin IAM.\n\n[Custom roles](/bigquery/docs/access-control#bigquery-custom-roles) won't be\nautomatically updated. To update a custom role with\nthe [required permissions](/bigquery/docs/work-with-saved-queries#required_permissions),\nsee [Edit an existing custom role](/iam/docs/creating-custom-roles#edit-role).\n\nWhat's next\n-----------\n\n- To learn how to create saved queries, see [Create saved queries](/bigquery/docs/work-with-saved-queries).\n- To learn how to manage saved queries, see [Manage saved queries](/bigquery/docs/manage-saved-queries)."]]