Using Sql Server 2012
I am using the following code where ever I am creating a temp table #wt3 in my stored proc code. But when I hit execute to create this SP I get the error mentioned below, at the second instance of creating this temp table:
IF (OBJECT_ID('tempdb..#wt3')) IS NOT NULL
DROP TABLE #wt3
SET ANSI_WARNINGS OFF
SELECT TOP 0 * INTO #wt3 FROM db_template.dbo.DimTime
Msg 2714, Level 16, State 1, Procedure rollup_scores, Line 1463
There is already an object named '#wt3' in the database.
What am I missing?