sql表错误怎么解决空间问题?

时间:2018-12-26 08:01:33

标签: sql-server database-design multiple-columns sql-query-store

my query

我在sql server上进行了一次查询,该查询帮助我删除了列(Name_Arabic)中的空格,但没有帮助我,我使用了另一个查询来拆分列,我可以在此查询中解决此问题吗?

我用于拆分列的代码

SELECT        Name_Arabic,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_10
                            WHERE        (Ordinal = 1)) AS Col1,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_9
                            WHERE        (Ordinal = 2)) AS Col2,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_8
                            WHERE        (Ordinal = 3)) AS Col3,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_7
                            WHERE        (Ordinal = 4)) AS Col4,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_6
                            WHERE        (Ordinal = 5)) AS Col5,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_5
                            WHERE        (Ordinal = 6)) AS Col6,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_4
                            WHERE        (Ordinal = 7)) AS Col7,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_3
                            WHERE        (Ordinal = 8)) AS Col8,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_2
                            WHERE        (Ordinal = 9)) AS Col9,
                         (SELECT        Part
                            FROM            dbo.CustomStringSplit(dbo._2.Name_Arabic, ' ') AS CustomStringSplit_1
                            WHERE        (Ordinal = 10)) AS Col10

1 个答案:

答案 0 :(得分:0)

有人可以帮助我解决这个问题,我希望它会帮助任何寻求这种东西的人

UPDATE yourtable SET Name_Arabic = LTRIM(Name_Arabic)