Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF ... ELSE Problem
Message
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
IF ... ELSE Problem
Miscellaneous
Thread ID:
00450951
Message ID:
00450951
Views:
70
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
Next
Reply
Map
View

Click here to load this message in the networking platform