I've a stored procedure that does something like this:
SELECT Id
INTO #temp
FROM table
WHERE ...
DELETE FROM #temp
INNER JOIN table2 ON a=b
WHERE ...
But it's running slowly. When I try to view the Execution Plan I can't since the SQL Server Management Studio says "Msg 208, Level 16, State 0, Line 31 Invalid object name '#temp'."
Is there any way to view the execution plan (or the execution details (not the plan)) for such script?