Hi,
Does SQL (MS SQL 2005) SPs allow/have: IF ELSEIF ELSE,
structure?
IF something = 1
ELSEIF something = 2
ELSE something = anything else
OR
a SWITCH/CASE?
I can find examples for inside a query
Select f1,f2
Case f1
WHERE '1' then this
WHERE '2' then something else
But can not find an example for:
CASE @MyVar
WHERE '1' then
BEGIN
Select *
From Mytable
End
Where '2' then
Begin
Select *
From Mytable2
End
Any help would be appreciated.
Thanks
Rodney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf
Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2955
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6