- DECLARE @TOTALV BIGINT
- DECLARE @InitialValue BIGINT
- SET @InitialValue=1
- SET @TOTALV=12
- WHILE (@InitialValue<=@TOTALV)
- BEGIN
- print @InitialValue
- SET @InitialValue=@InitialValue+1
- END
This code snippet for Use While LOOP in SQL.
This code snippet for Use While LOOP in SQL.