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 |
|
satish.gorijala
Posting Yak Master
182 Posts |
Posted - 2009-07-14 : 02:44:29
|
| Hi Can any one give an example of update query using case. i tried but getting errorUpdate Test set Code = case when Code = 1 then 'A'When Code = 2 then 'B' when Code = 3 then 'c'is it right? if not plz can you provide correct oneG. Satish |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-07-14 : 03:00:52
|
[code]Update Test set Code = case when Code = 1 then 'A'When Code = 2 then 'B' when Code = 3 then 'c'end[/code] Hope can help...but advise to wait pros with confirmation... |
 |
|
|
satish.gorijala
Posting Yak Master
182 Posts |
Posted - 2009-07-14 : 03:32:38
|
| Thank you.G. Satish |
 |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-07-14 : 03:52:33
|
welcome ^^ lets learn sql togther Hope can help...but advise to wait pros with confirmation... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-14 : 13:45:28
|
| i assume the above statement was for example purpose as you cant assign string values to integer field Code (i see you've used Code=1,2...) |
 |
|
|
|
|
|