Using the LTRIM() and RTRIM() SQL Server Functions

Using RTRIM() to remove trailing spaces

 SELECT  TOP 100
     RTRIM(firstname) + ' ' + lastname AS " RTRIM"
FROM  Students

Using LTRIM() to remove leading spaces

 SELECT  TOP 100
     LTRIM(disenrollment_type)         
FROM    disenrollmentTypes
 Collapse All    Expand All
Custom Search

SQL Server Information and Resources