Skip to content

Instantly share code, notes, and snippets.

@LyleScott
Created February 28, 2020 16:11
Show Gist options
  • Select an option

  • Save LyleScott/e9ef47ecea98c7b8918d1ed74bf0abd4 to your computer and use it in GitHub Desktop.

Select an option

Save LyleScott/e9ef47ecea98c7b8918d1ed74bf0abd4 to your computer and use it in GitHub Desktop.

Revisions

  1. LyleScott created this gist Feb 28, 2020.
    8 changes: 8 additions & 0 deletions snowflake_drop_tables_workaround.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    SELECT CONCAT('DROP TABLE ', table_name, ' ;')
    FROM your_database_name.information_schema.tables
    WHERE table_name like '%_STAGING';

    -- 1) Then, click “COPY” to get the TSV results.
    -- 2) Paste all those commands to a Snowflake worksheet
    -- 3) Review carefully
    -- 4) Select all DELETE queries and execute the query