-
-
Save gonsalu/2299950 to your computer and use it in GitHub Desktop.
Using variables with sp_executesql
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 @test INTEGER; | |
SET @test = 0; | |
EXEC sp_executesql N'SELECT @test_out = 1', N'@test_out INTEGER OUTPUT', @test_out=@test OUTPUT; | |
PRINT @test; -- prints 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment