In SQL Server 2017, you can use this syntax, but not in earlier versions:
SELECT Name = TRIM(Name) FROM dbo.Customer;
in sql server 2008 r2 with ssis expression we have the trim function .
SQL Server Integration Services (SSIS) is a component of the Microsoft SQL Server database software that can be used to perform a broad range of data migration tasks.
you can find the complete description on this link
http://msdn.microsoft.com/en-us/library/ms139947.aspx
but this function have some limitation in itself which are also mentioned by msdn on that page. but this is in sql server 2008 r2
TRIM(" New York ") .The return result is "New York".