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;

Back to Snowflake cookbook page