--查询分析器连接你的SQL服务器,选择你的数据库,然后写上如下代码,按F5执行:update name set id=''
where id like '%aa%'

解决方案 »

  1.   

    谢谢~但刚才我执行了一下,字段id里数据全没了~
    我只想替换掉代aa的字符,改怎么写?id字段下数据是xxxaa
    xxxaa我只想把aa去掉
      

  2.   

    update name set id=replace(id,'aa','')
    where id like '%aa%'
      

  3.   

    还得麻烦一下
    出现下面错误服务器: 消息 8116,级别 16,状态 1,行 1
    函数 replace 的参数 1 的数据类型 ntext 无效。
      

  4.   

    你的字段类型是ntext?? 那就麻烦了.
      

  5.   

    --如果你的字段中的数据长度不超过4000,可以用这样的方法:update name set id=replace(cast(id as nvarchar(4000)),N'aa','')
    where id like '%aa%' and datalength(id)<=8000
      

  6.   

    不超过4000的,建议你的字段直接用nvarchar类型,不要用ntext,ntext字段在处理上极不方便.