sql 替换字符串

MSSQL替换语句:

update 表名 set 字段名=replace(cast(字段名 as varchar(8000)),'abc.com','123.com')


例如:

update PE_Article set Content=replace(cast(Content as varchar(8000)),'http://news.163.com/','http://edu.cnzz.cc/')
其中

PE_Article 为表名 

Content为字段名

http://news.163.com/为要替换的内容 

http://edu.cnzz.cc/为替换后的内容。

操作方法很简单,用查询分析器。

原文地址:https://www.cnblogs.com/poissonnotes/p/3465578.html