开发者

Linked connection between MS SQL SERVER and Sybase ,Unicode problem

I added linked server on MS SQL SERVER 2008 with Sybase ASE 12.5 databases, everything works fine, but i've got problem with开发者_JAVA百科 unicode strings.

from MS SQL when i'am running "SELECT * FROM OPENQUERY ( SYTEST ,'SELECT Name FROM PRODUCT')" and the result set contains wrong characters

a?›a??a??a? a?”

a??a??a?¬a??a? a??

Name column in Sybase is of nvarchar type , names are written in unicode.

Problem occurs only when ms sql server is running on windows server operating system, There is no problem on ms sql-servers running on Windows 7 and XP, where I got correct result.


try to use N@parameter when making query


If it works on 2 separate installs, you compare and check the linked server settings using sp_serveroption, especially collation compatible and collation name

If these are the same, check any DSN and Sybase driver settings in the OS


There is a case like this in my company I've created a linked server from SQL Server 2014 to the IBM AS/400 (i series) and faced with the same problem.

I'm not sure about the different between 2014 and 2008 handle the unicode chars but I think it not much, if any.

How to
1. login to the SQL studio
2. right click the linked server then select "properties"
3. select "Server options" in left pane
4. set "Use remote collation" to "True"
5. in "Collation name", choose your unicode (here is the basic list - https://technet.microsoft.com/en-us/library/ms180175%28v=sql.105%29.aspx"

My problems solved this way! (I played a lot with connection strings with no desired results)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜