替换字段中的某一字符串

来源:互联网 发布:用友软件600588 编辑:程序博客网 时间:2024/06/04 17:43

update   mytable  
  set   myfield   =   replace(myfield,"毛收入","净增收"); 

 

varchar和nvarchar类型是支持replace,所以如果你的text不超过8000可以先转换成前面两种类型再使用replace。  
           update    表名    
           set    字段名=replace(convert(varchar(8000),字段名),'要替换的字符','替换成的值')