Sql server 2008, unique temp tables

In my server code, I create a temp table (named #temp), insert some data, and then delete the temporary table. If more than one user of this section of the code will work at the same time (creating a temporary table), will sql server 2008 create a temporary table for each user or create 1 global temp table? If its one table, I assume that I will have problems when the same table will be created several times?

+7
source share
1 answer

From MSDN :

You can create local and global temporary tables. Local temporary tables are visible only in the current session, and global temporary tables are visible for all sessions
...
If a local temporary table is created in a stored procedure or an application that can be executed simultaneously by several users, the Database Engine should be able to distinguish between tables created by different users. The Database engine does this internally by adding a numeric suffix to each name of the local temporary table. The full name of the temporary table stored in the sysobjects table in tempdb consists of the name of the table specified in the CREATE TABLE statement and the system numeric suffix. So that the suffix table_name specified for the local temporary name cannot exceed 116 characters.

+8
source

All Articles