Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error with SET
Message
 
 
To
17/06/2008 13:26:23
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01324831
Message ID:
01324832
Views:
11
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
Previous
Reply
Map
View

Click here to load this message in the networking platform