MSCEWI4052

Some functional table elements may have been reordered to a new Alter Table statement.

This EWI was added for an old version of SQL Server SnowConvert

Severity

Medium

Description

This EWI is added when different table elements do not have a functional equivalence in Snowflake or have a transformation planned. A new Alter Table statement is generated and commented out to avoid compilation problems.

Code Example

Input Code:

ALTER TABLE
    [Person].[EmailAddress]
ADD
    Dummy_Column VARCHAR(32),
    Another_Column datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL DEFAULT SYSUTCDATETIME()
    CONSTRAINT [DF_EmailAddress_rowguid] DEFAULT 5 FOR [rowguid],
    

Output Code:

ALTER TABLE
Person.EmailAddress
ALTER rowguid SET DEFAULT 5;


/*** MSC-ERROR - MSCEWI4050 - DEFAULT CONSTRAINT MOVED TO A NEW ALTER TABLE STATEMENT ***/
ALTER TABLE
    Person.EmailAddress
ADD
    Dummy_Column VARCHAR(32);

/*** MSC-WARNING - MSCEWI4051 - INVALID TABLE ELEMENTS WERE REORDERED ***/    
--ALTER TABLE
--    Person.EmailAddress
--ADD
--    Another_Column datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL DEFAULT SYSUTCDATETIME() /*** MSC-ERROR - MSCEWI1031 - SYSUTCDATETIME FUNCTION NOT SUPPORTED ***/
;  

Recommendations

  • If there are no valid table elements in the default clause, the alter table will be totally commented out.

  • If you need more support, you can email us at snowconvert-support@snowflake.com

Last updated