I'm attempting to do this in a procedure:

```
DECLARE @a bit = 1;
BEGIN
    SELECT * INTO #aTemp FROM OPENROWSET( ... );

    IF @a = 0
    BEGIN
        SELECT ... INTO #bTemp FROM #aTemp;
    END
    ELSE
    BEGIN
        SELECT ... INTO #bTemp FROM #aTemp;
    END
END

```

I get the error:

```
Msg 2714, Level 16, State 1, Line 10
There is already an object named '#bTemp' in the database.

```

Why is this happening and is there a work around?

**Update**

I've attempted to add a `DROP` statement as suggested [here](http://social.msdn.microsoft.com/Forums/sqlserver/en-US/45535754-514f-4ce5-baee-d43eb543f931/select-into-temp-table), but it still does not work:

```
DECLARE @a bit = 1;
BEGIN
    SELECT * INTO #aTemp FROM OPENROWSET( ... );

    IF @a = 0
    BEGIN
        IF OBJECT_ID('[tempdb]..#bTemp') IS NOT NULL
        BEGIN
            DROP TABLE #bTemp;
        END

        SELECT ... INTO #bTemp FROM #aTemp;
    END
    ELSE
    BEGIN
        IF OBJECT_ID('[tempdb]..#bTemp') IS NOT NULL
        BEGIN
            DROP TABLE #bTemp;
        END

        SELECT ... INTO #bTemp FROM #aTemp;
    END
END

```