update #test 
set filed=replace(filed,'a','cccc')
把它写成函数就灵活了

解决方案 »

  1.   

    --借用一楼,改改
    update #test 
    set filed=replace(filed,'a','cccc')
    where substring(filed,1,1)=a
      

  2.   

    update 表 set 字段=stuff(字段,charindex('a',字段),1,'cccc')
      

  3.   

    update 表 set 字段=stuff(字段,charindex('a',字段),1,'cccc')
    这一个是正解!
      

  4.   

    update 表 set 字段=stuff(字段,charindex('a',字段),1,'cccc')
    ========
    如果字段中没有a 会把该字段置NULLupdate #test
    set field=stuff(field,1,1,'cccc')
    where substring(field,1,1)='a'
    select * from #test
      

  5.   

    --update 表 set 字段=stuff(字段,charindex('a',字段),1,'cccc')
    --这个好!比我的好!:)
      

  6.   

    update 表 set 字段=stuff(字段,charindex('a',字段),1,'cccc') where charindex('a',字段)<>0
      

  7.   

    支持 summerICEREDTEA的说法, 
    "update 表 set 字段=stuff(字段,charindex('a',字段),1,'cccc')"这个方法是错误的.
    vivianfdlpw的是正解.STUFF ( character_expression , start , length , character_expression ) 
    参数
    start
    是一个整形值,指定删除和插入的开始位置。如果 start 或 length 是负数,则返回空字符串。如果 start 比第一个 character_expression 长,则返回空字符串。
      

  8.   

    update tb_name set col_name='ccc'+substring(col_name,2,len(col_name)-1) where left(col_name,1)='a'
    注释:tb_name  :表名
          col_name :列名