MSCEWI2085

Redundant reference to a Table in UpdateStatement removed.

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

Severity

Low

Description

This warning is added when the Table which is being used in the UpdateStatement is referenced in the From Clause. Since it is not necessary, and it improves performance, it is commented and the warning is added.

Example code

Input code

UPDATE ATableName
FROM 
  BTableName btableAlias, 
  ATableName atableAlias 
SET 
  col1 = btableAlias.col1
WHERE 
  atableAlias.col2 = btableAlias.col2;

Output code

UPDATE ATableName AS atableAlias
  SET
    atableAlias.col1 = btableAlias.col1
  FROM
    BTableName btableAlias,
-- ** MSC-WARNING - MSCEWI2085 - TABLE COMMENTED TO IMPROVE UPDATE PERFORMANCE **
--    ATableName atableAlias
    WHERE
      atableAlias.col2 = btableAlias.col2;

Recommendations

Last updated