日期:2014-05-18 浏览次数:20620 次
declare @t table (id int, name nvarchar(50)) insert into @t select 1,'http://www.abc.com' insert into @t select 2,'http://www.abc.com' select * from @t update @t set name=replace(name,'abc','xy') select * from @t /* id name ----------- -------------------------------------------------- 1 http://www.abc.com 2 http://www.abc.com (2 行受影响) (2 行受影响) id name ----------- -------------------------------------------------- 1 http://www.xy.com 2 http://www.xy.com (2 行受影响)*/
------解决方案--------------------
update tb set col = replace(col,'http://www.abc.com','http://www.xy.com') --或 update tb set col = replace(col,'.abc.','.xy.')