We're replicating the data from Oracle to SQL Server using Attunity.
In Oracle database , the table MEMO has a Description column which has some value.
(for ID = 1)
Description = 'This is test record'
But SQL Server is not showing that value in the Description column(where id =1), it is showing empty.
And when I'm querying the same table using Dbeaver , the Description column is showing a character 'p'.
Description = 'P'
I tried to copy in Notepad++ enabling show all characters but still no use. Help me in this strange behavior.
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