Search code examples
sqlsql-servertemp

Where is #Temp Stored ? OR How is #temp Stored


I know #temp is temp. Table valid for particular session only. but if i define #temp in two different session, and run them simultaneously will that conflict. if no then how actually these tables are stored in memory. And how is that different from ##Temp?????


Solution

  • From CREATE TABLE

    The full name of a temporary table as stored in the sysobjects table in tempdb is made up of the table name specified in the CREATE TABLE statement and the system-generated numeric suffix.

    So it is stored in the tempdb.

    Also from Temporary Tables in SQL Server

    Temporary tables and table variables are created in the TempDB database