Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scrpt questions
Message
From
25/04/2001 11:59:34
 
 
To
24/04/2001 13:55:18
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00499152
Message ID:
00499645
Views:
24
if NOT (some condition)
begin
..
..
end
else
begin
..
..
end

You need the begin...end if you are going to do multiple statments in the TRUE or FALSE parts of the IF.

>Hi,
>
>Is there any way in Query analyzer to:
>
>1) return from an ENTIRE script instead of just a batch within the script? I would like to (within my sql file) check for a condition, and if not acceptable, NOT run the entire file regardless of how many batches (as defined with 'go') there are. For example:
>if NOT (some condition)
>   return
>   do something
>   go
>
>do something else
>go
>
>do something else
>go
>If (some condition) fails, I don't want ANY of the remainder of the script to run.
>
>
>2)call one sql script from within another?
>
>Thanks!
Thanks,
Dan Jurden
djurden@outlook.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform