20 October 2018        Add to Favorites   Report

Finding the list of tables/views in a schema/database in Snowflake

To get the list of all the views, and its definition in a database,

select table_catalog, table_schema, table_name, view_definition, is_secure 
from information_schema.views where table_catalog = 'my-database';

To get the list of all the tables, and its definition in a database,

select table_catalog, table_schema, table_name
from information_schema.tables where table_catalog = 'my-database';

Or alternately, we can use the show tables command:

Show tables like 'sales%';

or 

Show views like 'sales%';

or simply,

show views;

Read great educational content like this and a lot more ! Create my free account now 🎁

Copied