mtillman-921105 (7/1/2011)
OK, now I wish that I could borrow the head-desk avatar from WayneS! :angry:
Feel free to borrow it anytime... it's at http://www.dreamwidth.org/userpic/21008/20791
(Sometimes, I'd like to change my avatar to this one - but I think Steve would ask me to change it.)
[evil grin]Hmm... isn't Steve on vacation right now?[/evil grin]
Anyway, to answer your question: From BOL:CREATE TABLE
A local temporary table created within a stored procedure or trigger can have the same name as a temporary table that was created before the stored procedure or trigger is called. However, if a query references a temporary table and two temporary tables with the same name exist at that time, it is not defined which table the query is resolved against.
(emphasis mine)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes