Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IF ... ELSE Problem
Message
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
IF ... ELSE Problem
Divers
Thread ID:
00450951
Message ID:
00450951
Vues:
71
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform