Dynamical SQL runs in its own batch. While that batch has visibility to existing temporary object, any temporary object that is created within the batch will be removed when the batch is complete.
-Mike
>Yes... the dynamic results can't see the #temp table and vice-versa.
>
>>Did you try creating a temp table using just one # ? This will create a temporary table for the current session.
>>
>>
>>
>>>So no way to do it in multi-user safe style?
>>>
>>>
>>>
>>>>>But that solution is problematic in a multi-user environment. If 2 or more people call the sp at the same time, kaboom...
>>>>
>>>>Yes, the global temporary tables are not for the multi-user environment.