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 |
|
Scott
Posting Yak Master
145 Posts |
Posted - 2004-10-12 : 07:45:21
|
I have some dynamic SQL:Declare @Proc varchar(1000), @TheValue intset @Proc = 'declare @Value int 'set @Proc = @Proc + 'Select @Value = somevalue from '+@SomeTablevariable 'exec(@Proc)@TheValue = @Value Does not work because @Value is not declared. How can I assign @Value to @TheValue?ThanksScott |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2004-10-12 : 08:12:37
|
| try this....Declare @Proc varchar(1000), @TheValue intdeclare table #temp (somevalue int)set @Proc = 'Insert into #temp Select @Value = somevalue from ' + @SomeTablevariable exec(@Proc)select @TheValue = somevalue from #tempHemanth GorijalaBI Architect / DBA... |
 |
|
|
|
|
|