MSCEWI4026

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

Severity

Low

Description

This EWI is added when a Common Table Expression With a Delete From is transformed to a Create or Replace Table.

Code Example

Input Code:

WITH Duplicated AS (
SELECT *, ROW_NUMBER() OVER (PARTITION BY ID ORDER BY ID) AS RN
FROM WithQueryTest
)
DELETE FROM Duplicated
WHERE Duplicated.RN > 1

Output Code:

/*** MSC-WARNING - MSCEWI2055 - WITH DELETE QUERY TURNED TO CREATE TABLE ***/
CREATE OR REPLACE TABLE PUBLIC.WithQueryTest AS SELECT
*
FROM PUBLIC.WithQueryTest
QUALIFY ROW_NUMBER()
OVER (PARTITION BY ID ORDER BY ID) = 1 ;

Recommendations

Last updated