This is in SQL Server 2005. I have a varchar
column and some rows contain trailing space, e.g. abc
, def
.
I tried removing the trailing space with this command:
update thetable
set thecolumn = rtrim(thecolumn)
But the trailing space remains. I tried to find them using:
select *
from thetable
where thecolumn <> rtrim(thecolumn)
But it returned nothing.
Are there some settings that I am not aware that influences trailing space check?
EDIT:
I know that there is trailing space from SSMS, when I copy paste the value from the grid to the editor, it has trailing space.
thecolumn
?varchar
the first query should have worked (though the second query won't work as trailing spaces are ignored in such comparisons)