Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF ... ELSE Problem
Message
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00450951
Message ID:
00451094
Views:
23
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.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform