|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, March 25, 2013 12:34 PM
Points: 1,064,
Visits: 223
|
|
Running SQL2005 sp4 and I have linked server to DB2400 UDB for iSeries using IBMDASQL provider. I use openquery method to retrieve data using a view in DB2. I am running into an issue which I believe is related to collation . I return a title, "Let?s Look Series PK 1 Fall" When I look in the source database, it is really "Let’s Look Series PK 1 Fall" so it is turning the ' to a ?.
Anybody have any ideas.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 1:24 PM
Points: 6,826,
Visits: 11,950
|
|
It is likely related to collation. For ANSI data types (VARCHAR, CHAR and TEXT) SQL Server will replace any characters in the data not present in the codepage (per the the collation) with a question mark. For Unicode data types (NVARCHAR, NCHAR and NTEXT) while a collation is applied for sorting and comparison purposes the collation does not impose any character restrictions and therefore no replacements to question marks will occur.
Example return a Unicode COMBINING GREEK KORONIS whicih looks like a single-quote as a varchar yields a question-mark but shows us the actual character as nvarchar:
[code="sql"]DECLARE @v INT = 835 SELECT CAST(NCHAR(@v) AS VARCHAR(10)), CAST(NCHAR(@v) AS NVARCHAR(10))code]
What is the data type of the title column on DB2? Is it stored as some type of Unicode? What is the data type of the column you're bringing the result into? Or are you just selecting the data using SSMS and are seeing the question mark in the results pane? If you're storing it in a table try changing the data type of the column in which you're storing the data to one of the Unicode types and the question mark issue should disappear. If you are seeing the question mark in the SSMS results pane then it could be that the Linked Server provider is getting involved and causing the issue.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|