Home

INSERT statements should explicitly list the columns to be set

Rule description

  • INSERT statements should explicitly list the columns to be set

 

Non-compliant Code Example

INSERT INTO Production.UnitMeasure   --Non compliant code (Columns list is missing)
VALUES (N'FT', N'Feet', '20080414');

Compliant Code Example

INSERT INTO Production.UnitMeasure (Name, UnitMeasureCode, ModifiedDate)    --Compliant code (Explicitly list the columns to be set)
VALUES (N'Square Yards', N'Y2', GETDATE());
Visual Expert 2020
 VETSQLRULE11