Link to home
Start Free TrialLog in
Avatar of Dovberman
DovbermanFlag for United States of America

asked on

Need to use Case structure logic in a stored procedure

What is the syntax for Case locic in a stored procedure;

For a given column, I need to return a value based on the value of the column.

ie: SELECT * FROM FileName WHERE

Case ColumName.Value
     Case 'A'
          Return '1'
     Case 'B'
          Return '2'
End Case
AS TerritoryNumber

Thanks



ASKER CERTIFIED SOLUTION
Avatar of wjester
wjester

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dovberman

ASKER

Both answers are what I asked for. Link gives me a basis for more extensive use of the Case structure.

Thanks