[source,sql,diff-id=1,diff-type=noncompliant]
----
IF @SortOrder = 1
  BEGIN
    SET @SortOrder = 0
    SELECT LastName FROM Employees ORDER BY LastName
  END
ELSE IF @SortOrder = 2
  BEGIN
    SET @SortOrder = 0
    SELECT LastName FROM Employees ORDER BY LastName -- Noncompliant
  END
ELSE
  BEGIN
    SET @SortOrder = -1
    SELECT LastName FROM Employees
  END
GO
----