Jay Johengen Altamahaw-Ossipee, North Carolina, United States
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Conditional Logic
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01324772
Message ID:
01324772
Views:
49
I need to do something like the following in a query.
DO WHILE looping through fetched rowsand @MyVar changes value
BEGINIF @MyVar = 1BEGIN
Do This
ENDIF @MyVar > 1BEGIN
Do This
ENDIF @MyVar = 1and there were no @MyVar > 1BEGIN
Do This
ENDEND