Mass-replace a substring


/ Published in: SQL
Save to your folder(s)

Example below


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.