您的位置:首页 > 博客中心 > 数据库 >

MSSQL 字符串替换语句

时间:2022-03-14 03:30

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/为替换后的内容。
操作方法很简单,用查询分析器。

热门排行

今日推荐

热门手游