I tried this code -
UPDATE Table
SET Name = RTRIM(LTRIM(Name))
Data type of Name is varchar(25)
None of the leading and t
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.
Kindly use below query it will remove space new line etc..
select LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(Name, CHAR(10), CHAR(32)),CHAR(13), CHAR(32)),CHAR(160), CHAR(32)),CHAR(9),CHAR(32))))