Mega Code Archive

 
Categories / MSSQL Tutorial / Table
 

Temporary Tables

Each temporary table is implicitly dropped by the system. Each temporary table is stored in the tempdb system database. Temporary tables can be local or global.  Local temporary tables are removed at the end of the current session.  They are specified with the prefix #table_name.  Global temporary tables, which are specified with the prefix ##, are dropped at the end of the session that created this table. CREATE TABLE #project_temp         (project_no CHAR(4) NOT NULL,         project_name CHAR(25) NOT NULL) SELECT project_no, project_name        INTO #project_temp1        FROM project