How to View Schema in Snowflake

Galaxy Glossary

How do I view the schema of a table in Snowflake?

Use SHOW and DESCRIBE commands to list tables and view column-level details in any Snowflake schema.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

Why do developers need to view a schema in Snowflake?

Confirming column names, data types, and constraints helps you write joins, validate ETL jobs, and detect breaking model changes.

What commands list all tables in a schema?

Run SHOW TABLES IN SCHEMA ;. The result set includes table name, kind, owner, row count, and comment.

How can I see every column in a table?

DESCRIBE TABLE

Use DESC TABLE schema.table_name; to return column order, names, data types, nullability, default values, and policy tags.

SHOW COLUMNS

SHOW COLUMNS IN TABLE schema.table_name; provides similar output but lets you query the results with RESULT_SCAN().

How do I filter or sort the SHOW output?

Wrap the command in a sub-query: SELECT * FROM TABLE(RESULT_SCAN(LAST_QUERY_ID())) WHERE type='NUMBER' ORDER BY ordinal_position;.

Can I view multiple tables at once?

Loop through table names in a scripting block, or generate SQL with SHOW TABLES + DESCRIBE TABLE for each table.

Best practices for inspecting schemas

Always include the database and schema in fully-qualified names. Store SHOW/RESULT_SCAN queries in version control so teammates reuse them.

Common mistakes and fixes

Omitting the schema qualifier: prefix tables with database.schema to avoid “table not found” in other contexts.

Using INFORMATION_SCHEMA for real-time structure: it can lag. Prefer SHOW or DESCRIBE for the latest metadata.

Additional questions

See the FAQ below for quick answers on permissions, large schemas, and querying RESULT_SCAN.

Why How to View Schema in Snowflake is important

How to View Schema in Snowflake Example Usage


-- Check the Customers table structure before adding an index
DESCRIBE TABLE analytics.public.customers;

How to View Schema in Snowflake Syntax


-- List tables in a schema
SHOW TABLES IN SCHEMA analytics.public;

-- View columns for one table
DESCRIBE TABLE analytics.public.customers;

-- Alternative column listing with queryable result
SHOW COLUMNS IN TABLE analytics.public.orders;

-- Find numeric columns in Orders
WITH cols AS (
  SHOW COLUMNS IN TABLE analytics.public.orders
)
SELECT "column_name", "data_type"
FROM   TABLE(RESULT_SCAN(LAST_QUERY_ID()))
WHERE  data_type ILIKE '%NUMBER%';

Common Mistakes

Frequently Asked Questions (FAQs)

Do I need special permissions to run SHOW or DESCRIBE?

You need the USAGE privilege on the database and schema plus OWNERSHIP or SELECT on the table.

How do I export the schema results?

Store the last query ID and wrap it with COPY INTO @~ to unload the RESULT_SCAN to CSV.

What if my schema has hundreds of tables?

Query SHOW TABLES into a temp table, then iterate with Snowflake Scripting to DESCRIBE each table automatically.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie
BauHealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.