Home

Unary prefix operators should not be repeated

Rule description

  • Unary prefix operators should not be repeated

 

Non-compliant Code Example

DECLARE @Number int;  
SET @Number = 50;  
IF NOT NOT (@Number > 100)   --Non compliant code (Unary operator is repeated)
    PRINT 'The number is greater then 100.';  
ELSE
    PRINT 'The number is less then 100.';

Compliant Code Example

DECLARE @Number int;  
SET @Number = 50;  
IF NOT (@Number < 100)   --Compliant code
    PRINT 'The number is greater then 100.';  
ELSE
    PRINT 'The number is less then 100.';
Visual Expert 2020
 VETSQLRULE16