Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove non-breaking spaces from a column in SQL server?

Tags:

I'm trying to remove a non-breaking space (CHAR 160) from a field in my table. I've tried using functions like RTRIM() to get rid of it, but the value is still there.

What do I need to do to remove the non-breaking space from the column?

like image 522
paparazzo Avatar asked Mar 05 '13 02:03

paparazzo


People also ask

How can remove space from column in SQL?

SQL Server TRIM() Function The TRIM() function removes the space character OR other specified characters from the start or end of a string. By default, the TRIM() function removes leading and trailing spaces from a string. Note: Also look at the LTRIM() and RTRIM() functions.

How do you remove a non breaking space in Oracle?

Try and dump the contents of the column to see what that non-breaking space really is. you can use translate , which will replace range of characters which are non printable from your string. check if the char is of ascii 160 or something else using instr or ascii functions.


1 Answers

Try using REPLACE

UPDATE Your_Table SET Your_Column = REPLACE(Your_Column, NCHAR(0x00A0), '') WHERE Id = x 
like image 128
Brian Rogers Avatar answered Sep 30 '22 21:09

Brian Rogers