Use of Select Case or Switch Statement


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Use of Select Case or Switch Statement

Hybrid View

  1. #1
    Daryl Shockey Guest

    Use of Select Case or Switch Statement


    Does anybody know if there is a way to do something equivalent to a "select
    case" or "switch" statement within a SQL stored procedure? I can't find
    anything in the online help for transact-sql and any help here would be *greatly*
    appreciated. Thanx!...

    --> Daryl

  2. #2
    Jim Keller Guest

    Re: Use of Select Case or Switch Statement


    Daryl,

    In MS SQL Server there is a CASE statement that should accomplish what you
    need to do. T-SQL help has a couple of good examples and you can nest the
    case statements to perform complex program flow or logic.

    HTH

    "Daryl Shockey" <dashockey44@yahoo.com> wrote:
    >
    >Does anybody know if there is a way to do something equivalent to a "select
    >case" or "switch" statement within a SQL stored procedure? I can't find
    >anything in the online help for transact-sql and any help here would be

    *greatly*
    >appreciated. Thanx!...
    >
    >--> Daryl



  3. #3
    David Satz Guest

    Re: Use of Select Case or Switch Statement

    there is a CASE statement in SQL Server 6.5+, also see
    http://www.mssqlserver.com/faq/development-iif.asp
    --
    HTH,
    David Satz
    Principal Web Engineer
    Hyperion Solutions
    { SQL Server 2000 SP2/6.5 SP5a } { Cold Fusion 5 SP1 } { VSS }
    (Please reply to group only - emails answered rarely)
    -----------------------------------------------------------------
    "Daryl Shockey" <dashockey44@yahoo.com> wrote in message
    news:3cea546c@10.1.10.29...
    >
    > Does anybody know if there is a way to do something equivalent to a

    "select
    > case" or "switch" statement within a SQL stored procedure? I can't find
    > anything in the online help for transact-sql and any help here would be

    *greatly*
    > appreciated. Thanx!...
    >
    > --> Daryl




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center