Created
January 17, 2022 15:45
-
-
Save James-McNeill/a076ccc08438f58ffa19561ec5526d1b 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 variable (a SQL Command, the var name, the datatype) | |
DECLARE @counter INT; | |
-- Set the counter to 20 | |
SET @counter = 20; | |
-- Print the initial value | |
SELECT @counter AS _COUNT; | |
-- Select and increment the counter by one | |
SELECT @counter = @counter + 1; | |
-- Print variable | |
SELECT @counter AS _COUNT; | |
-- Select and increment the counter by one | |
SELECT @counter += 1; | |
-- Print the variable | |
SELECT @counter AS _COUNT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment