Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to increment a variable in CASE statement
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SharadD
Starting Member

4 Posts

Posted - 08/22/2008 :  06:15:16  Show Profile  Reply with Quote
Can I increment a variable in a CASE statement

RyanRandall
Flowing Fount of Yak Knowledge

United Kingdom
1074 Posts

Posted - 08/22/2008 :  06:39:06  Show Profile  Reply with Quote
Huh? By increment a variable, do you mean add 1 to it? If so, then why would you need a case statement?

set @myVariable = @myVariable + 1


Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 08/22/2008 :  09:55:57  Show Profile  Reply with Quote
may be this is what he meant

SET @Variable=CASE condition1 THEN @variable +1 ELSE some other processing END
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6065 Posts

Posted - 08/22/2008 :  10:00:43  Show Profile  Reply with Quote
quote:
Originally posted by SharadD

Can I increment a variable in a CASE statement


Yes

Be One with the Optimizer
TG
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000