Trim spaces in string - LTRIM RTRIM not working

后端 未结 8 1790
你的背包
你的背包 2021-02-03 19:14

I tried this code -

UPDATE Table
SET Name = RTRIM(LTRIM(Name))

Data type of Name is varchar(25)

None of the leading and t

8条回答
  •  梦谈多话
    2021-02-03 20:13

    I suspect, some non readable(Non-ascii characters) inside the name column, that might not get removed as part of TRIM calls.

    select convert(varbinary, Name) from table
    

    Reading the HEX output from above query should reveal the same.

    Kindly read this to find how to write functions to remove such characters.

提交回复
热议问题