SQL中,对不法文字进行替换成*号。
我是这样写的:
update A
set RContents = Replace(RContents,'死','*')
where rid=2但是在字段名RContents出了点问题。。
我不知道要怎么把RContents里面的文字给提取出来。
知道的朋友帮我说下。。
谢谢

解决方案 »

  1.   

    但是在字段名RContents出了点问题。。
    我不知道要怎么把RContents里面的文字给提取出来。是这里不明白
      

  2.   


    declare @a table(spbm char(3),jhsl int)insert @a 
    select '001',10 union all 
    select '001',30 union all 
    select '002',10update @a 
    set spbm=replace(spbm,'0','*')select * from @a
    /*
    spbm  jhsl    
     
    **1   10
    **1   30
    **2   10
    */
      

  3.   

    搞定拉。。
    原来我的类型是NTEXT的。
    不能使用REPLACE进行替换。
      

  4.   

    先把ntext转化成基本类型的 然后replace