MSCEWI1099

Create table as subquery with no data is not supported in Snowflake

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Severity

Low

Description

Snowflake does not support the CTAS option without data, the same output is obtained by adding the Limit 0 clause at the end of the Select Query

Code Example

Input Code:

CREATE TABLE TABLE01 AS 
   SELECT 
      * 
   FROM 
      TABLE02 WITH NO DATA;

Output Code:

CREATE TABLE PUBLIC.TABLE01 AS
   SELECT
      *
   FROM
      PUBLIC.TABLE02
   LIMIT 0
-- ** MSC-WARNING - MSCEWI1099 - CREATE TABLE AS SUBQUERY WITH NO DATA IS NOT SUPPORTED IN SNOWFLAKE, TRANSLATED TO LIMIT 0 **
-- WITH NO DATA

Recommendations

Last updated