Home

@@IDENTITY should not be used

Rule description

  • @@IDENTITY should not be used

 

Non-compliant Code Example

Declare @id INT;
SET @id = @@IDENTITY   --Non compliant code

Compliant Code Example

Declare @id INT;
SET @id = SCOPE_IDENTITY()   --Compliant code
Visual Expert 2020
 VETSQLRULE26