sql select * from as temp code example
Example 1: create temp table in sql
-- CREATE TEMP TABLE
Create Table #MyTempTable (
EmployeeID int
);
Example 2: sql server: creating temp table by selecting records from other tables
SELECT *
INTO #<Temp_Table_Name>
FROM <TableName>
WHERE <Conditions>
ORDER BY <Col_Names OrderSeq>
OPTION <Options>