Last active
December 29, 2015 18:38
-
-
Save binki/c3553c478c89c98a5df2 to your computer and use it in GitHub Desktop.
T-SQL flow control: `DECLARE` with default is like `SET`, labels inside of constructs
This file contains hidden or 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 @done BIT = 0; | |
IF 1=0 | |
BEGIN | |
faker: | |
PRINT 'x'; | |
SET @done = 1; | |
END | |
DECLARE @not BIT = @done; | |
PRINT @not; | |
IF @done = 0 | |
GOTO faker; |
This file contains hidden or 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
0 | |
x | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment