Drops

DROP statements

Some parts in the output code are omitted for clarity reasons.

DROP TABLE

Syntax in SQL Server

DROP TABLE [ IF EXISTS ] <table_name> [ ,...n ]  
[ ; ]  

Syntax in Snowflake

DROP TABLE [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]

Translation

Translation for single DROP TABLE statements is very straightforward. As long as there is only one table being dropped within the statement, it's left as-is.

For example:

IN -> SqlServer_01.sql
DROP TABLE IF EXISTS [table_name]
OUT -> SqlServer_01.sql
DROP TABLE IF EXISTS table_name;

The only noteworthy difference between SQL Server and Snowflake appears when the input statement drops more than one table. In these scenarios, a different DROP TABLE statement is created for each table being dropped.

For example:

IN -> SqlServer_02.sql
DROP TABLE IF EXISTS [table_name], [table_name2], [table_name3]
OUT -> SqlServer_02.sql
DROP TABLE IF EXISTS table_name;

DROP TABLE IF EXISTS table_name2;

DROP TABLE IF EXISTS table_name3;

Known Issues

No issues were found.

No related EWIs.

Last updated