Wenn Sie die Ansicht INFORMATION_SCHEMA.COLUMNS abfragen, wird in den Abfrageergebnissen jede Spalte (jedes Feld) einer Tabelle in einer eigenen Zeile dargestellt.
Die Ansicht INFORMATION_SCHEMA.COLUMNS hat das folgende Schema:
Spaltenname
Datentyp
Wert
TABLE_CATALOG
STRING
Die ID des Projekts, das das Dataset enthält
TABLE_SCHEMA
STRING
Der Name des Datasets, das die Tabelle enthält (auch als datasetId bezeichnet)
TABLE_NAME
STRING
Der Name der Tabelle oder Ansicht (auch als tableId bezeichnet)
COLUMN_NAME
STRING
Der Name der Spalte
ORDINAL_POSITION
INT64
Der 1-indexierte Versatz der Spalte in der Tabelle; bei einer Pseudospalte wie _PARTITIONTIME oder _PARTITIONDATE ist der Wert NULL
IS_NULLABLE
STRING
YES oder NO, je nachdem, ob der Spaltenmodus NULL-Werte zulässt
. WennSTRING oder ARRAY<STRING> übergeben wird, wird die Sortierspezifikation zurückgegeben, sofern vorhanden. Andernfalls wird NULL zurückgegeben.
COLUMN_DEFAULT
STRING
Der Standardwert der Spalte, falls vorhanden. Andernfalls lautet der Wert NULL.
ROUNDING_MODE
STRING
Der Rundungsmodus, der für in das Feld geschriebene Werte verwendet wird, wenn sein Typ ein parametrisierter NUMERIC oder BIGNUMERIC ist. Andernfalls ist der Wert NULL.
POLICY_TAGS
ARRAY<STRING>
Die Liste der Richtlinien-Tags, die an die Spalte angehängt sind
Bereich und Syntax
Für Abfragen dieser Ansicht muss ein Dataset- oder Regions-Qualifier verwendet werden. Für Abfragen mit einem Dataset-Qualifier benötigen Sie Berechtigungen für das Dataset.
Für Abfragen mit einem Regions-Qualifier müssen Sie Berechtigungen für das Projekt haben.
Weitere Informationen finden Sie unter Syntax.
In der folgenden Tabelle werden die Regions- und Ressourcenbereiche für diese Ansicht erläutert:
DATASET_ID: die ID Ihres Datasets. Weitere Informationen finden Sie unter Dataset-Qualifier.
Beispiel
Im folgenden Beispiel werden aus der Ansicht INFORMATION_SCHEMA.COLUMNS Metadaten für die Tabelle population_by_zip_2010 im Dataset census_bureau_usa abgerufen. Dieses Dataset ist Teil des öffentlichen Dataset-Programms von BigQuery.
Da sich die abgefragte Tabelle in einem anderen Projekt (bigquery-public-data) befindet, fügen Sie dem Dataset die Projekt-ID im folgenden Format hinzu: `project_id`.dataset.INFORMATION_SCHEMA.view; beispielsweise so: `bigquery-public-data`.census_bureau_usa.INFORMATION_SCHEMA.TABLES.
Die folgenden Spalten sind nicht in den Abfrageergebnissen enthalten, da sie derzeit für eine zukünftige Verwendung reserviert sind:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-17 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.COLUMNS\u003c/code\u003e view provides metadata about each column in a table, with each row representing a single column.\u003c/p\u003e\n"],["\u003cp\u003eQuerying this view requires specific IAM permissions, including \u003ccode\u003ebigquery.tables.get\u003c/code\u003e and \u003ccode\u003ebigquery.tables.list\u003c/code\u003e, which are included in roles like \u003ccode\u003eroles/bigquery.admin\u003c/code\u003e and \u003ccode\u003eroles/bigquery.dataViewer\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe schema of the \u003ccode\u003eCOLUMNS\u003c/code\u003e view includes information like \u003ccode\u003eTABLE_CATALOG\u003c/code\u003e, \u003ccode\u003eTABLE_SCHEMA\u003c/code\u003e, \u003ccode\u003eTABLE_NAME\u003c/code\u003e, \u003ccode\u003eCOLUMN_NAME\u003c/code\u003e, \u003ccode\u003eDATA_TYPE\u003c/code\u003e, and several other attributes detailing column properties.\u003c/p\u003e\n"],["\u003cp\u003eQueries against the \u003ccode\u003eCOLUMNS\u003c/code\u003e view must use either a dataset or region qualifier, requiring permissions for the specified dataset or project respectively, and view names are case-sensitive.\u003c/p\u003e\n"],["\u003cp\u003eCertain columns in the \u003ccode\u003eCOLUMNS\u003c/code\u003e view, such as \u003ccode\u003eIS_GENERATED\u003c/code\u003e and \u003ccode\u003eIS_STORED\u003c/code\u003e, are currently reserved for future use and are excluded from example query results.\u003c/p\u003e\n"]]],[],null,["# COLUMNS view\n============\n\nThe `INFORMATION_SCHEMA.COLUMNS` view contains one row for each column\n(field) in a table.\n\nRequired permissions\n--------------------\n\nTo query the `INFORMATION_SCHEMA.COLUMNS` view, you need the following\nIdentity and Access Management (IAM) permissions:\n\n- `bigquery.tables.get`\n- `bigquery.tables.list`\n\nEach of the following predefined IAM roles includes the preceding\npermissions:\n\n- `roles/bigquery.admin`\n- `roles/bigquery.dataViewer`\n- `roles/bigquery.dataEditor`\n- `roles/bigquery.metadataViewer`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nWhen you query the `INFORMATION_SCHEMA.COLUMNS` view, the query results contain\none row for each column (field) in a table.\n\nThe `INFORMATION_SCHEMA.COLUMNS` view has the following schema:\n\nScope and syntax\n----------------\n\nQueries against this view must include a dataset or a region qualifier. For\nqueries with a dataset qualifier, you must have permissions for the dataset.\nFor queries with a region qualifier, you must have permissions for the project.\nFor more\ninformation see [Syntax](/bigquery/docs/information-schema-intro#syntax).\nThe following table explains the region and resource scopes for this view:\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: any [dataset region name](/bigquery/docs/locations). For example, ```region-us```.\n- \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the ID of your dataset. For more information, see [Dataset qualifier](/bigquery/docs/information-schema-intro#dataset_qualifier).\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n | **Note:** You must use [a region qualifier](/bigquery/docs/information-schema-intro#region_qualifier) to query `INFORMATION_SCHEMA` views. The location of the query execution must match the region of the `INFORMATION_SCHEMA` view.\n\n\u003cbr /\u003e\n\nExample\n-------\n\nThe following example retrieves metadata from the `INFORMATION_SCHEMA.COLUMNS`\nview for the `population_by_zip_2010` table in the\n[`census_bureau_usa`](https://console.cloud.google.com/bigquery?p=bigquery-public-data&d=census_bureau_usa&page=dataset)\ndataset. This dataset is part of the BigQuery\n[public dataset program](https://cloud.google.com/public-datasets/).\n\nBecause the table you're querying is in another project, the\n`bigquery-public-data` project, you add the project ID to the dataset in the\nfollowing format:\n```````\u003cvar translate=\"no\"\u003eproject_id\u003c/var\u003e````.```\u003cvar translate=\"no\"\u003edataset\u003c/var\u003e```.INFORMATION_SCHEMA.```\u003cvar translate=\"no\"\u003eview\u003c/var\u003e;\nfor example,\n```bigquery-public-data`.census_bureau_usa.INFORMATION_SCHEMA.TABLES``.\n\nThe following columns are excluded from the query results because they are\ncurrently reserved for future use:\n\n- `IS_GENERATED`\n- `GENERATION_EXPRESSION`\n- `IS_STORED`\n- `IS_UPDATABLE`\n\n**Note:** `INFORMATION_SCHEMA` view names are case-sensitive. \n\n```googlesql\n SELECT\n * EXCEPT(is_generated, generation_expression, is_stored, is_updatable)\n FROM\n `bigquery-public-data`.census_bureau_usa.INFORMATION_SCHEMA.COLUMNS\n WHERE\n table_name = 'population_by_zip_2010';\n```\n\nThe result is similar to the following. For readability, some columns\nare excluded from the result.\n\n\u003cbr /\u003e\n\n```\n+------------------------+-------------+------------------+-------------+-----------+-----------+-------------------+------------------------+-----------------------------+-------------+\n| table_name | column_name | ordinal_position | is_nullable | data_type | is_hidden | is_system_defined | is_partitioning_column | clustering_ordinal_position | policy_tags |\n+------------------------+-------------+------------------+-------------+-----------+-----------+-------------------+------------------------+-----------------------------+-------------+\n| population_by_zip_2010 | zipcode | 1 | NO | STRING | NO | NO | NO | NULL | 0 rows |\n| population_by_zip_2010 | geo_id | 2 | YES | STRING | NO | NO | NO | NULL | 0 rows |\n| population_by_zip_2010 | minimum_age | 3 | YES | INT64 | NO | NO | NO | NULL | 0 rows |\n| population_by_zip_2010 | maximum_age | 4 | YES | INT64 | NO | NO | NO | NULL | 0 rows |\n| population_by_zip_2010 | gender | 5 | YES | STRING | NO | NO | NO | NULL | 0 rows |\n| population_by_zip_2010 | population | 6 | YES | INT64 | NO | NO | NO | NULL | 0 rows |\n+------------------------+-------------+------------------+-------------+-----------+-----------+-------------------+------------------------+-----------------------------+-------------+\n \n```\n\n\u003cbr /\u003e"]]