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 |
|
nvakeel
Yak Posting Veteran
52 Posts |
Posted - 2008-02-11 : 10:24:25
|
| I have two variables being updated with same field and on same condition. LikeUpdate x = Case @Y > 0 then 3 else 4Update Z = Case When @Y>0 then 3 else 4is there any other simple process to do this. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-11 : 10:29:35
|
[code]UPDATE Table1SET X = CASE WHEN @Y > 0 THEN 3 ELSE 4 END, Z = CASE WHEN @Y > 0 THEN 3 ELSE 4 END[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
nvakeel
Yak Posting Veteran
52 Posts |
Posted - 2008-02-11 : 11:11:38
|
| thanks. |
 |
|
|
|
|
|