insert into temp table add identity column code example
Example 1: create and insert into temp table
IF(@Debug = 1)
BEGIN
--TempTables for Testing
CREATE TABLE #_TempTable
(
FIRST INT,
SECOND INT,
);
INSERT INTO #_TempTable
SELECT @FIRST,
@SECOND
SELECT * FROM #_TempTable
END;
Example 2: Best way to create a temp table with same columns and type as a permanent table
select top 0 *
into #mytemptable
from myrealtable