Return to Snippet

Revision: 33804
at October 13, 2010 16:15 by powerthru


Initial Code
update TABLENAME set COLUMNNAME = replace(COLUMNNAME, '\r', '');

Initial URL

                                

Initial Description
sometimes we botch an import, and end up with return or newline characters in the field. So fields which should be empty have \r in them, or fields with text data have an invisible trailing newline. This makes it impossible to match the text values. This sql statement removes the \r characters in a field.

Initial Title
Remove trailing newlines from database fields

Initial Tags
mysql

Initial Language
SQL