Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
beyonder422
Posting Yak Master
124 Posts |
Posted - 2005-12-08 : 16:56:01
|
| I want to run a dynamic SQL statement within a proc and have it's result set to a @local variable within that same proc, like below:declare @sql nvarchar (1000), @test varchar(100)set @sql = 'select top 1 xyz from xzy'set @test = (EXEC sp_executesql @SQL)select @testIs this possible?www.beyonder422.com |
|
|
beyonder422
Posting Yak Master
124 Posts |
Posted - 2005-12-08 : 18:22:05
|
| answered my own question:exec sp_executesql @sql, N'@build_count nvarchar(5) OUTPUT', @build_count OUTPUTwww.beyonder422.com |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|