-
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
-
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
-
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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|