如何处理"白色空间"不是空的,不能修剪?

时间:2017-05-04 20:55:49

标签: sql sql-server sql-server-2008

查看SSSMS的屏幕截图。有一些"白色空间"。我试图将它们更新为0,但失败了。我试过了:

  1. Update Where COL_NAME IS NULL
  2. where
  3. 复制&粘贴白色空间'到isnumeric(colname)条款。
  4. 数据类型为nvarchar。

    cast as varbianry表示它们不是数字。

    0x 0x 0x 0x 0x 0x 0x 0x 0x 0x

    的输出
    $scope.document = $document;
    

    enter image description here

1 个答案:

答案 0 :(得分:1)

您可能需要替换其他空格字符,如回车符,换行符和制表符(13,10,09)。

... replace(replace(replace(col,char(13),''),char(10),''),char(9),'')

update ... 
where nullif(ltrim(rtrim(replace(replace(replace(col,char(13),''),char(10),''),char(9),''))),'') is null