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 |
Rollie
Starting Member
4 Posts |
Posted - 2012-10-04 : 21:55:50
|
guys, need your help on this please. I need to update all status into I which is inactive with the given data which is card no only. I am using SQL 2005table name: Tempid name card no status1 Celso 5306722 A2 andrew 5306724 A3 albert 5306723 A4 allan 5306735 A5 Brian 5306774 A6 Joseph 5306796 A7 stephen 5306801 Ahere is the resultCelso 5306722 IAllan 5306735 IJoseph 5306796 IStephen 5306801 IMy QueryUpdate From TempSet Status = 'I'where card_no = '5306722, 5306735, 5306796, 5306801'but it doesn't workThanks for the help guys. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Rollie
Starting Member
4 Posts |
Posted - 2012-10-05 : 01:29:48
|
Thank you for your reply tkizer but i keep getting this errorMsg 8114, Level 16, State 5, Line 1Error converting data type varchar to numeric.Im using SQL Server Manager Studio ExpressThanks again hope you can help with this. |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2012-10-05 : 01:56:24
|
quote: Originally posted by Rollie Thank you for your reply tkizer but i keep getting this errorMsg 8114, Level 16, State 5, Line 1Error converting data type varchar to numeric.Im using SQL Server Manager Studio ExpressThanks again hope you can help with this.
If Card_no is of varchar type, then applywhere card_no in ('5306722', '5306735', '5306796', '5306801')--Chandu |
|
|
Rollie
Starting Member
4 Posts |
Posted - 2012-10-05 : 02:04:59
|
tkizer:i figured it out the correct syntax was where card_no in ('5306722', '5306735', '5306796', '5306801')it work.Thanks a lot. God bless |
|
|
Rollie
Starting Member
4 Posts |
Posted - 2012-10-05 : 02:06:43
|
Thanks bandi your right.it work already.Thanks a lot guys. |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2012-10-05 : 02:44:19
|
quote: Originally posted by Rollie Thanks bandi your right.it work already.Thanks a lot guys.
Welcome--Chandu |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|