New answers tagged

0

Not really. Instead, you could do something like SELECT CONCAT("UPDATE ", table_schema, ".", table_name, " SET foo = replace(foo, 'this', 'that');") FROM information_schema.tables WHERE ... to generate the desired 50+ UPDATE statements. Then copy and paste them into the mysql commandline tool. (Or you could construct a shell ...


5

If you are guaranteed to only ever use the 26 letters of the US English alphabet (both upper-case and lower-case versions) then sure, you can get away with using LIKE and/or PATINDEX with the simple range notation of [a-z] But, if you might get characters not found in the en-US alphabet yet available in various Code Pages / Collations for VARCHAR data (e.g. ...


3

I've got a post here that does something similar. Basically I'm using a recursive CTE to go loop over and over again replacing one "bad" character at a time. I'm using STUFF to strip 1 character (although you can use it to replace with a space) and PATINDEX to find the location of the character I want to remove. You could modify it slightly to do what you ...



Top 50 recent answers are included