|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to update all occurencies of value in the table?
Hi,
I have in the table different rows and columns filled with some numbers (1,2,0,9 etc.). I would like to replace all occurencies of number "2" with value "3". Is it possible with one UPDATE command or I have to write "program"? Thanks in advance ![]() |
|
#2
|
||||
|
||||
|
update yourtable
set columnname = 3 where columnname = 2 |
|
#3
|
|||
|
|||
|
Or, you could use the replace string function if the data has more than just one number in each column.
|
|
#4
|
|||
|
|||
|
In one query?
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > How to update all occurencies of value in the table? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|