Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SharadD
Starting Member
4 Posts |
Posted - 2008-08-22 : 06:15:16
|
Can I increment a variable in a CASE statement |
|
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts |
Posted - 2008-08-22 : 06:39:06
|
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. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-22 : 09:55:57
|
may be this is what he meantSET @Variable=CASE condition1 THEN @variable +1 ELSE some other processing END |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-08-22 : 10:00:43
|
quote: Originally posted by SharadD Can I increment a variable in a CASE statement
YesBe One with the OptimizerTG |
|
|
|
|
|