Temporary table in SQL server causing ‘ There is already an object named’ error
You are dropping it, then creating it, then trying to create it again by using SELECT INTO. Change to: In MS SQL Server you can create a table without a CREATE TABLE statement by using SELECT INTO