Drops

DROP statements

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Applies to

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

DROP TABLE

Syntax in Transact-SQL

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