DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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




Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links