create temp table sql from select code example
Example 1: create temp table in sql
-- CREATE TEMP TABLE
Create Table #MyTempTable (
EmployeeID int
);
Example 2: select into temp table
SELECT *
INTO #temp
FROM (
SELECT col1, col2
FROM table1
) AS x