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 |
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2010-04-19 : 11:07:14
|
| I need to update Dist from 808 to D18I tried this but it updated too many rows:Update iclaimsYrTempset Dist = Replace(Dist, '808', 'D18')What am I doing wrong?Do I need a where clause? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-19 : 11:10:00
|
if you need to replace only exact ones do:-Update iclaimsYrTempset Dist = Replace(Dist, '808', 'D18')where Dist='808' replace will replace the occurances of pattern wherever it can find it, even within column values------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2010-04-19 : 11:16:30
|
| Thanks the where clause is what I needed as you are right it did replace them all because I didn't specify. I'm find now. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-19 : 11:17:34
|
| ok great------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|