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

后端 未结 3 1953
鱼传尺愫
鱼传尺愫 2020-12-05 04:52

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

相关标签:
3条回答
  • 2020-12-05 05:24

    If the above solutions does not work, try CHAR instead of NCHAR

    UPDATE Your_Table
    SET Your_Column = REPLACE(Your_Column, CHAR(160), '')
    WHERE Id = x
    

    CHAR worked for me.

    0 讨论(0)
  • 2020-12-05 05:29

    Try using REPLACE

    UPDATE Your_Table
    SET Your_Column = REPLACE(Your_Column, NCHAR(0x00A0), '')
    WHERE Id = x
    
    0 讨论(0)
  • 2020-12-05 05:49

    You could also use

    REPLACE(The_txt, NCHAR(160), ' ')
    
    0 讨论(0)
提交回复
热议问题