CONTINUE (TSQL Statement)

Execution jumps to the next iteration of the WHILE loop.

Syntax

CONTINUE

Remarks

In nested loops, CONTINUE jumps to the next iteration of the loop in which it occurs (innermost loop).

Example

DECLARE @i INT = 0;

WHILE @i < 5
  BEGIN
  IF @i = 2
    BEGIN
    SET @i += 1;
    CONTINUE;
    END

  PRINT @i;
  SET @i += 1;
  END

PRINT 'End';

The result is:

0
1
3
4
End