Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scrpt questions
Message
From
25/04/2001 12:32:12
 
 
To
25/04/2001 11:59:34
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00499152
Message ID:
00499675
Views:
24
Dan - your example won't work with "go"s in between the begin/end
thanks,
Ken

>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!
Ken B. Matson
GCom2 Solutions
Previous
Reply
Map
View

Click here to load this message in the networking platform