Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error with SET
Message
 
 
À
17/06/2008 13:26:23
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01324831
Message ID:
01324832
Vues:
12
This message has been marked as the solution to the initial question of the thread.
>If I uncomment the two lines in the code below, I get this error:
>
>
>Msg 156, Level 15, State 1, Line 134
>Incorrect syntax near the keyword 'else'
>
>
>The variable is declared and I am using the same SET with other variables.
>
>
>if exists (select * from #a where s = @FileName)
        BEGIN
>	--SET @FileExists = 'Y'
>	print @PATH + @Filename + ' exists'
       END
>else
       BEGIN
>	--SET @FileExists = 'N'
>	print @PATH + @Filename + ' does not exist'
      END
       >drop table #a
>
Add BEGIN/END blocks if you want to execute more than 1 statement.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform