How to trim a string in SQL Server before 2017?
SELECT LTRIM(RTRIM(Names)) AS Names FROM Customer
To Trim on the right, use:
SELECT RTRIM(Names) FROM Customer
To Trim on the left, use:
SELECT LTRIM(Names) FROM Customer
To Trim on the both sides, use:
SELECT LTRIM(RTRIM(Names)) FROM Customer