Trimming text strings in SQL Server 2008

后端 未结 7 1740
无人共我
无人共我 2020-12-30 19:05

I have a table in a SQL Server 2008 database. This table has a nvarchar(256) column called \'Name\'. Unfortunately, the values in this field have extra spaces included. For

7条回答
  •  -上瘾入骨i
    2020-12-30 19:28

    I know this is an old question but I just found a solution which creates a user defined function using LTRIM and RTRIM. It does not handle double spaces in the middle of a string.

    The solution is however straight forward:

    User Defined Trim Function

提交回复
热议问题