Posted By

lottegis on 08/18/14


Tagged


Versions (?)

Mass-replace a substring


 / Published in: SQL
 

Example below

  1. UPDATE TABLE
  2. SET COLUMN = REPLACE(COLUMN, search_string, replace_string)
  3. WHERE COLUMN LIKE '%search_string%'
  4.  
  5.  
  6. --Example
  7. UPDATE DatabaseName.TableName
  8. SET PDF_NAME = REPLACE(PDF_NAME, '+', '_')
  9. WHERE PDF_NAME LIKE '%+%'

Report this snippet  

You need to login to post a comment.