Skip to content

Instantly share code, notes, and snippets.

@sayle-doit
Last active October 30, 2023 22:26
Show Gist options
  • Save sayle-doit/f337034938f8e763c76c1484dbf6dc99 to your computer and use it in GitHub Desktop.
Save sayle-doit/f337034938f8e763c76c1484dbf6dc99 to your computer and use it in GitHub Desktop.
Query that returns out all BigQuery tables inside of a project.
--
-- This query will pull out all tables that exist inside of the currently
-- selected project.
--
-- Note by default this hits the US multi-region, so if using a different
-- region then change region-us below to that region name.
--
SELECT
CONCAT(table_catalog, ':', table_schema, '.', table_name) AS table_name
-- This line uses the dot notation, so if you need that versus traditional
-- notation (or to copy into queries versus the CLI) use this line below
-- instead of the above.
--CONCAT(table_catalog, '.', table_schema, '.', table_name) AS table_name
FROM
`region-us`.INFORMATION_SCHEMA.TABLES
WHERE
table_type = 'BASE TABLE'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment