atricapilla atricapilla - 10 months ago 70
SQL Question

SQL Server 2008: How to find trailing spaces

How can I find all column values in a column which have trailing spaces? For leading spaces it would simply be

select col from table where substring(col,1,1) = ' ';

Answer Source

SELECT col FROM tbl WHERE col LIKE '% '