dbTalk Databases Forums  

Special characters in MSSQL.

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Special characters in MSSQL. in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kenneth.osenbroch@telenor.com
 
Posts: n/a

Default Special characters in MSSQL. - 03-07-2006 , 03:16 AM






Hi,

I have a MSSQL Server communicating with an Oracle database through a
MSSQL linked server using a MS ODBC connection.

If I query the Oracle database through the Oracle ODBC 32Bit Test, the
result is fine:

select addrsurname from address where addrnr = 6666;
HÅKANSSON

If I do the same query within the SQL Query Analyzer (using the linked
server), I get:

select * from openquery(TESTSW, 'select addrsurname from address where
addrnr = 6666');
HKANSSON

I have tried to both check and uncheck the Automatic ANSI to OEM
conversion, but the result remains the same.

Does anyone know what to do to make the result display the special
characters in SQL Query Analyzer?


Thanks,
Kenneth


Reply With Quote
  #2  
Old   
m.bohse@quest-consultants.com
 
Posts: n/a

Default Re: Special characters in MSSQL. - 03-07-2006 , 04:01 AM






Kenneth,

obviously your SQL server and the Oracle DB use a different collation.
In your linked server properties on the tab server_options you can
change the option "use remote collation" from True to False. That
should solve your problem.

Another option would be to convert the character values to
your(preferred) collation like this:
SELECT CAST(addrsurname AS varchar(25)) COLLATE French_CS_AS -- Fill in
your collation here


Good luck
Markus


Reply With Quote
  #3  
Old   
kenneth.osenbroch@telenor.com
 
Posts: n/a

Default Re: Special characters in MSSQL. - 03-07-2006 , 04:52 AM



Hi Markus, and thanks for your response.

I tried both your suggestions without any luck. Do I need to restart
the MSSQL Server service or something?

Thanks,
Kenneth


Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Special characters in MSSQL. - 03-07-2006 , 04:28 PM



(kenneth.osenbroch (AT) telenor (DOT) com) writes:
Quote:
I have a MSSQL Server communicating with an Oracle database through a
MSSQL linked server using a MS ODBC connection.

If I query the Oracle database through the Oracle ODBC 32Bit Test, the
result is fine:

select addrsurname from address where addrnr = 6666;
HÅKANSSON

If I do the same query within the SQL Query Analyzer (using the linked
server), I get:

select * from openquery(TESTSW, 'select addrsurname from address where
addrnr = 6666');
H?KANSSON

I have tried to both check and uncheck the Automatic ANSI to OEM
conversion, but the result remains the same.

Does anyone know what to do to make the result display the special
characters in SQL Query Analyzer?
Obviously there is a collation clash of some sort between Oracle and
SQL Server.

I don't know Oracle, but what data type is addrsurname? Is it varchar
or nvarchar (or whatever they may be called on the Oracle side)? If
it is some 8-bit data type, what is the code page for that column?

If I am to guess, I hold the ODBC driver as the prime suspect. Define
the linked server with the MSDAORA provider instead, or even better
Oracle's own OLE DB provider. (MSDAORA does not support Oracle 9 and
10, I believe.)

There are a few options to set for linked servers in SQL Server, but
I don't really think thees are the knobs to pull here.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #5  
Old   
kenneth.osenbroch@telenor.com
 
Posts: n/a

Default Re: Special characters in MSSQL. - 03-08-2006 , 08:49 AM



Hi,

Creating the linked server with Microsoft OLE DB Provider for ODBC
Drivers solved the problem. Thanks for your help.

Cheers,
Kenneth


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.