mssql Data List

/ 목차 /
- MSSQL 반복문 1에서 ~ 10까지
MSSQL 반복문 1에서 ~ 10까지
DECLARE @Counter INT = 1; WHILE @Counter <= 10 BEGIN -- Perform some actions or calculations IF @Counter = 5 BEGIN -- Break out of the loop prematurely BREAK; END IF @Counter = 3 BEGIN -- Skip the current iteration and continue to the next iteration SET @Counter = @Counter + 1; CONTINUE; END -- Output the value of @Counter PRINT 'Counter: ' + CONVERT(VARCHAR, @Counter); -- Increment the counter SET @Counter = @Counter + 1; END
Comment