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 |
alissababa
Starting Member
5 Posts |
Posted - 2007-09-04 : 17:59:21
|
Hello, I would like to change all the names in a certian row is 1 to 0.I've done this stuff :Update TableName SET RowA=0 Where RowA=1But this is what I got : Invalid Column name "0"Can you help me please?Thanks//// |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-04 : 18:10:31
|
Is RowA column integer or varchar? E 12°55'05.25"N 56°04'39.16" |
 |
|
alissababa
Starting Member
5 Posts |
Posted - 2007-09-05 : 03:36:10
|
that was a wrong example I guess.I would like to do this instead : Update TableName SET RowA=B Where RowA=Aboth RowA and RowB are varchar. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-05 : 03:48:26
|
Update TableName SET RowA = 'B' Where RowA = 'A' E 12°55'05.25"N 56°04'39.16" |
 |
|
alissababa
Starting Member
5 Posts |
Posted - 2007-09-05 : 03:56:10
|
Update TableName SET RowA = 'B' Where RowA = 'A'That's what I've done in the first place.it should work, right, there's nothing that wouldn't make it work or so....That's weird. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-05 : 04:01:55
|
Are you sure you have two columns named "RowA" and "RowB" in the table "TableName"?Maybe you should post yuor actual query here and describe what you would like to do? E 12°55'05.25"N 56°04'39.16" |
 |
|
alissababa
Starting Member
5 Posts |
Posted - 2007-09-05 : 06:35:31
|
It worked. Thanks!the '' was the problem. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-09-05 : 06:59:07
|
quote: Originally posted by alissababa Hello, I would like to change all the names in a certian row is 1 to 0.I've done this stuff :Update TableName SET RowA=0 Where RowA=1But this is what I got : Invalid Column name "0"Can you help me please?Thanks////
In no case you will have such error as long as you assign numbers to the columnYou would get error only if you usedUpdate TableName SET RowA=[0] Where RowA=1MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|