I have a SSIS package that extracts data from a view and creates a flat file from the data. Everything was working until last night. The package failed with the message "Data conversion failed. The data conversion for column "LastName" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page."
I pinned it down to an Afrikaans character ʼn.
Now, the ASCII() function returns the code 63, for the question mark '?', which is incorrect. The REPLACE() function cannot handle it either. It simply does not replace it. If I do SELECT LastName from MyView, I get the last name WITH the character in there. I get "Villaseʼnor". But if I do PRINT LastName from MyView, I get "Villase?or".
Now, this is puzzling. If replace can't get to it, I can't check for it and then replace it thus avoiding the problem. I did find a workaround for the issue by using CONVERT(varchar,LastName), which replaces the ʼn for a question mark.
But, am I missing something here? Is there a different collation I can use, or something? Or a different data type in the SSIS package?
Much appreciate any insight to this puzzle.
Raphael
rferreira