sql server create temporary table from select code example
Example: create temporary table sql
-- CREATE TEMP TABLE
Create Table #MyTempTable (
EmployeeID int
);
-- DROP TEMP TABLE
IF OBJECT_ID('tempdb..#MyTempTable') IS NOT NULL DROP TABLE #MyTempTable