Hi,
I have code like
------------------------------
declare @sql varchar(128), @myvar varchar(16)
set @sql = 'declare @myvar varchar(16) select @myvar = somefield from sometable where wherecondition'
execute (@sql)
select @myvar
-------------------------
Now - the 'inside' @myvar is NOT available to the 'outside' program! How can I get it from the dynamic sQL statement? or can I?
I also notes that if the 'inside' statement selects into a #temp table, that #temp table is NOT available to the outside statement - putting it to a ##temp table DOES work, but this seems to go against the documentation that says a #temp table is available to the ENTIRE CONNECTION - not just batch/task. PLus ##temp tables are avaialble to ALL connections (according to docs) and I certainly don't want that.
Thanks!
Ken B. Matson
GCom2 Solutions