Find empty tables in Snowflake

This query returns list of tables in a database without any rows.

Query

select t.table_schema || '.' ||  t.table_name as "table_name"
from information_schema.tables t
where t.table_type = 'BASE TABLE'
    and t.row_count = 0
order by "table_name";

Columns

  • table - table name with schema name

Rows

  • One row represents one table
  • Scope of rows: only empty tables (without rows)
  • Ordered by schema and table name

Sample results