In this post explains how to use the CONTINUE statement in SQL Server (Transact-SQL) with syntax and examples.
In SQL Server, the CONTINUE statement is used when you are want a WHILE LOOP to execute again. It will ignore any statements after the CONTINUE statement
The syntax for the CONTINUE statement in SQL Server (Transact-SQL) is:
There are no parameters or arguments for the CONTINUE statement.
Let's look at an example that shows how to use the CONTINUE statement in SQL Server (Transact-SQL).
For example:
In this CONTINUE statement example, we will restart the WHILE LOOP if the variable @site_value is not equal to 2, as specified by the IF...ELSE statement.