批量替换数据库某字段部分内容发布时间:2012/12/25 18:01:00 阅读次数:

  

update 表名 set 字段名=replace(字段名,’要替换的内容’,’替换后的内容’)

UPDATE NC_DownAddress
SET DownFileName = REPLACE(DownFileName, 'http://ftp1.netshield.cn:8082',
      'http://ftp1.netshield.cn')

 

SELECT *
FROM NC_DownAddress
WHERE (DownFileName LIKE '%http://ftp1.netshield.cn%')

 

 

update yonghuxinxi set yonghubianhao=replace(yonghubianhao,'-','-')

update yonghuxinxi set yonghubianhao=replace(yonghubianhao,'--','-')