I've got a table with two columns, ID
and Value
. I want to change a part of some strings in the second column.
Example of Table:
ID Value
---------------------------------
1 c:emp123abc111
2 c:emp123abc222
3 c:emp123abc333
4 c:emp123abc444
Now the 123
in the Value
string is not needed. I tried UPDATE
and REPLACE
:
UPDATE dbo.xxx
SET Value = REPLACE(Value, '%123%', '')
WHERE ID <= 4
When I execute the script SQL Server does not report an error, but it does not update anything either. Why is that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…