sql server select into temp table code example Example: select into temp table SELECT * INTO #temp FROM ( SELECT col1, col2 FROM table1 ) AS x