Want some more ...
CREATE the temptable as ##
Run the insert code ... do NOT close that instance of SSMS.
Perform the SELECT * FROM ## statement .. right it returns the correct number of rows
Open a second instance of SSMS
Then perform ONLY the SELECT * FROM ## statement in this second instance of SSMS
And yes, you do get the same number of rows returned, Intriguing indeed.
Why intriguing? Table names starting with ## are considered to be global
temporary tables. They're available to all sessions, and are only discarded when no sessions use them anymore.
Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis