Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional Logic
Message
From
17/06/2008 12:24:35
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
17/06/2008 11:28:37
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01324772
Message ID:
01324801
Views:
10
>I need to do something like the following in a query.
>
>
>
>DO WHILE looping through fetched rows and @MyVar changes value
>
>BEGIN
>
>IF @MyVar = 1
>     BEGIN
>          Do This
>     END
>
>IF @MyVar > 1
>     BEGIN
>          Do This
>     END
>
>IF @MyVar = 1 and there were no @MyVar > 1
>     BEGIN
>          Do This
>     END
>
>END
>
Edit: I read your question incorrectly.
Very fitting: http://xkcd.com/386/
Previous
Reply
Map
View

Click here to load this message in the networking platform