【问题标题】:SQL Sever table is not showing value for a column in a tableSQL Server 表未显示表中列的值
【发布时间】:2020-07-08 19:28:25
【问题描述】:

我们正在使用 Attunity 将数据从 Oracle 复制到 SQL Server。

在 Oracle 数据库中,表 MEMO 有一个 Description 列,该列具有一定的价值。

(for ID = 1)
Description = 'This is test record'

但是 SQL Server 没有在 Description 列中显示该值(其中 id =1),它显示为空。

当我使用 Dbeaver 查询同一个表时,Description 列显示一个字符“p”。

Description = 'P'

我尝试在 Notepad++ 中复制启用显示所有字符但仍然没有用。帮助我解决这种奇怪的行为。

【问题讨论】:

    标签: sql-server oracle attunity


    【解决方案1】:
     DECLARE @Result varchar(255)
           SET @Result = ''
    
           DECLARE @nchar nvarchar(1)
           DECLARE @position int
           SET @position = 1
           
           WHILE @position <= LEN(@nstring)
            BEGIN
                SET @nchar = SUBSTRING(@nstring, @position, 1)
            IF((ASCII(@nchar) BETWEEN 64 and 90) OR (ASCII(@nchar) BETWEEN 97 and 122) OR (ASCII(@nchar) BETWEEN 48 and 57) OR ASCII(@nchar) = 32)
                 BEGIN
                        SET @Result = @Result + @nchar
                 END
             ELSE 
                BEGIN
                 DECLARE @asciichar varchar(10)
                 SET @asciichar = ASCII(@nchar)
                 SET @Result = @Result + REPLACE(@nchar,CHAR(@asciichar),'')
               END
           SET @position = @position + 1
       END
    
    RETURN @Result
    
    END
    

    【讨论】:

      猜你喜欢
      • 2011-04-01
      • 1970-01-01
      • 2017-06-17
      • 1970-01-01
      • 1970-01-01
      • 2021-12-27
      • 1970-01-01
      • 2014-08-09
      • 1970-01-01
      相关资源
      最近更新 更多