20 Oct 18 · Ryan-Dallas ·       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;

Ryan-Dallas

posted on 20 Oct 18

Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too

Copied