SQL SERVER – TRIM() Function – UDF TRIM()
April 24, 2007 by pinaldave
SQL Server does not have function
which can trim leading or trailing spaces of any string. TRIM() is very
popular function in many languages. SQL does have LTRIM() and RTRIM()
which can trim leading and trailing spaces respectively. I was expecting
SQL Server 2005 to have TRIM() function. Unfortunately, SQL Server 2005
does not have that either. I have created very simple UDF which does
the same work.