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?
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.
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.
Try using REPLACE
UPDATE Your_Table SET Your_Column = REPLACE(Your_Column, NCHAR(0x00A0), '') WHERE Id = x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With