Snowflake snippets

Drop table in Snowflake if exists

Sometimes you just have to DROP a table that might or might not exists, without getting any error depending on the case. You can just use the following:

create temporary table mytemptable (id number, creation_date date);
SELECT * FROM mytemptable;
DROP TABLE IF EXISTS mytemptable;
Nicola Simboli

Nicola Simboli Senior Analytics Engineer

15+ years across SaaS, enterprise and consulting. Focused on scalable data platforms, metric reliability and analytics systems that teams actually use.

Back to Snowflake cookbook page