Skip to content

Instantly share code, notes, and snippets.

@binki
Last active December 29, 2015 18:38
Show Gist options
  • Save binki/c3553c478c89c98a5df2 to your computer and use it in GitHub Desktop.
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
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment