I have revised a procedure that builds a dynamic SQL statement to create and populate a temporary table. The syntax was something like this:
...'create #temp_' + CAST(GETGUID() AS VARCHAR(36)) ...
I asked a colleague if he knew why a unique identifier was being concatenated to the table name. He told me that in the past there were cases where temporary tables were shared across sessions and the data was messed up.
I know this is not possible since MSDN clearly states:
You can create local and global temporary tables. Local temporary tables are visible only in the current session, and global temporary tables are visible to all sessions.
Now (remembering the case) some colleagues think we should use the syntax above as a good practice but I do not like it and need proof there is no such bug or if it was it is already fixed.
Could anyone with experience in SQL Server 2005/2008 tell me if there ever was such case?