I need to insert data in my table variable to a temp table but it gives me the following error.
Msg 208, Level 16, State 0, Procedure sp_CreateScenario_q2, Line 70
Invalid object name '#tmpp1'.
Here is the code
IF OBJECT_ID('tempdb..#tmpp1') IS NOT NULL
DROP TABLE #tmpp1
INSERT INTO #tmpp1
SELECT
[PlanningHierarchyId]
,[ProductReferenceId]
,[PlanningYear]
,[PlanningSeason]
,[UpdatedBy]
FROM
@paramTable
Is there any way to do this?