>Ken,
>
>It is true that any temp. tables created within dynamic sql are scoped to the dynamic sql. BUT, if the temp table exists BEFORE the dynamic sql, it is within scope:
>
>CREATE TABLE #x (c int)
>
>EXECUTE ('insert into c values (1)')
>
>-Mike
Mike,
yeah - I discovered this - and is what I am using - thanks! I still think it is a PITA though :(
I also found out how to return into variables using sp_executesql, and that helps in a couple other instances. This was actually not in the SQL docs (at least I couldn't find it) I discovered it at SQL Expert site.
Thanks for your help!
Ken B. Matson
GCom2 Solutions