Inside a frequently executed stored procedure (sometimes up to 10-15 times per second), there are two particular statements that show up in Top 10 heaviest queries by cumulative CPU impact
These are DDL statements to create #Temp tables:
SELECT cast(0 as int) as rowId , Column1 as tColumn1 , Column2 as tColumn2 , ... , Column14 as tColumn14 , cast(0 as datetime) as tUTC , -1 as tRefId INTO #TempTable1 FROM Table1 WITH(NOLOCK) WHERE 0=1
SELECT tColumn1, ..., tColumn14, tUtc, tRefId INTO #TempTable2 FROM #TempTable1 WHERE 0=1
Any of above DDL, take on average 10-15 ms CPU time, simply to create a #temp table
Changing stored procedure's logic, to make it NOT create temp tables, is not an option
Question: How can temp table creation time be sped up, in terms of CPU time ?