Created
January 17, 2022 15:49
-
-
Save James-McNeill/969226f35b3f28c50b30c49404126a09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Declare the initial value | |
DECLARE @counter INT; | |
SET @counter = 20; | |
-- Print initial value | |
SELECT @counter AS _COUNT; | |
-- Create a loop | |
BEGIN; | |
-- Loop code starting point | |
WHILE @counter < 30 | |
SELECT @counter = @counter + 1; | |
-- Loop finish | |
END; | |
-- Check the value of the variable | |
SELECT @counter AS _COUNT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment