MSCEWI4062

Warning Precision In Convert Date And Time Zone.

Severity

Low

Description

This EWI is added when there are Dates or Time zones in which a precision has been included. This occurs when there is an Alter Table Statement with default column constraint and it is necessary to include it in the Create Table column.

Code Example

Input Code:

CREATE TABLE table1
(
  col1 integer,
  col2 varchar collate Latin1_General_CS,
  col3 DATETIME
);

ALTER TABLE table1
ADD 
    CONSTRAINT col3_constraint DEFAULT getdate() FOR col3;

Output Code:

CREATE OR REPLACE TABLE PUBLIC.table1 (
  col1 integer,
  col2 VARCHAR COLLATE 'EN-CS',
  col3 TIMESTAMP_NTZ(3) DEFAULT CURRENT_TIMESTAMP() ::
  /*** MSC-WARNING - MSCEWI4062 - CONVERT DATE AND TIME ZONE PRECISION. ***/
  TIMESTAMP(3)
)

-- ** MSC-ERROR - MSCEWI4058 - ONE OR MORE OF THE TABLE ELEMENT PARTS ARE NOT SUPPORTED IN SNOWFLAKE: DEFAULT TABLE CONSTRAINT **
--ALTER TABLE PUBLIC.table1
--ADD
--    CONSTRAINT col3_constraint DEFAULT getdate() FOR col3

Recommendations

Last updated