Hello All Again,
I found a KB article (Q120875) that this type of thing existed in SQL Server 4.2 and from another posting that it still exists in SQL Server 2000. I guess MS isn't going to fix it any time soon.
Gee, you would think it would be easy too!
>Hi All,
>Can anyone explain why I get an Error 2714 when I attempt to create a temporary table under separate branches of an IF statement?
>
>To reproduce the problem, try the following:
>create procedure StupidError as
>if (1 = 1) select 1 as 'Field1' into #tmpTable
>else select 2 as 'Field1' into #tmpTable
>Is my syntax off? If so, please enlighten me.
>
>I have a workaround so it's not a big deal at this point. But it was a major PITA when it cropped up.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao