Microsoft SQL Server Global Temp Table


Example

  • Will start with ## (##temp).

    Will be deleted only if user disconnects all connections.

    It behaves like a permanent table.

    CREATE TABLE ##NewGlobalTempTable(
                   StudentID      int,
                   StudentName    varchar(50), 
                   StudentAddress varchar(150))
    
    Insert Into ##NewGlobalTempTable values ( 1,'Ram','India');
    Select * from ##NewGlobalTempTable
    

Note: These are viewable by all users of the database, irrespective of permissions level.