Created
February 28, 2020 16:11
-
-
Save LyleScott/e9ef47ecea98c7b8918d1ed74bf0abd4 to your computer and use it in GitHub Desktop.
Snowflake DELETE TABLE LIKE workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment