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 |
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2004-03-04 : 11:30:21
|
| hi,I am trying to do something like this:declare @a intset @a=0select case @a when @a=0 then 1 end as ait gives an erroris it possible to use case statemeent for variables?He is a fool for five minutes who asks , but who does not ask remains a fool for life! |
|
|
raymondpeacock
Constraint Violating Yak Guru
367 Posts |
Posted - 2004-03-04 : 11:33:18
|
| Yes it is, the problem is in your syntax.SELECT CASE @a WHEN 0 THEN 1 END AS AORSELECT CASE WHEN @a = 0 THEN 1 END AS ARaymond |
 |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2004-03-04 : 12:27:28
|
quote: Originally posted by raymondpeacock Yes it is, the problem is in your syntax.SELECT CASE @a WHEN 0 THEN 1 END AS AORSELECT CASE WHEN @a = 0 THEN 1 END AS ARaymond
thanksI am totally pissed off, its been a loooong day He is a fool for five minutes who asks , but who does not ask remains a fool for life! |
 |
|
|
|
|
|