Yes - the table persists within the scope of the EXEC and not the outside
query, if you want it to persist in the outside query then you need to use a
global ## table, however, that will be accessible by anyone else on the
server.

If the ## table is no good for your situation, you will need to do all your
SQL dynamically.

--
Tony Rogerson
SQL Server MVP
http://www.sqlserverfaq.com?mbr=21
(Create your own groups, Forum, FAQ's and a ton more)