How do I do a simple 'Find and Replace" in MsSQL?

前端 未结 5 661
别那么骄傲
别那么骄傲 2020-12-12 23:12

Question is pretty self explanitory. I want to do a simple find and replace, like you would in a text editor on the data in a column of my database (which is MsSQL on MS Win

5条回答
  •  孤街浪徒
    2020-12-12 23:43

    The following query replace each and every a character with a b character.

    UPDATE 
        YourTable
    SET 
        Column1 = REPLACE(Column1,'a','b')
    WHERE 
        Column1 LIKE '%a%'
    

    This will not work on SQL server 2003.

提交回复
热议问题