#1CoolGuy
Ten Centuries
Points: 1189
More actions
May 19, 2008 at 10:10 am
#186775
I have a dynamic sql statement that returns an integer value like so.
Exec sp_executesql @sql
How do I assign the result of the dynamic sql to a variable
Declare @num as int
Select @num = Exec sp_executesql @sql
Thanks in advance
Piotr.Rodak
SSCrazy Eights
Points: 9376
May 19, 2008 at 10:13 am
#817289
Look at output parameters. You can pass the variable as an output parameter to your dynamic sql and assign it there
Regards
Piotr
...and your only reply is slàinte mhath
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply