SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


scrambled character issue


scrambled character issue

Author
Message
gogozeebra
gogozeebra
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 22
Dear All,

We got an issue related to scrambled character like 「╔¢╬¸╩íÁþ┴ª╣½╦¥」. The issue is we have many databases with different collation.

For instance, the collation of the database in China is SQL_1xCompat_CP850_CI_AS and the collation of the database in U.S. is SQL_Latin1_General_CP1_CI_AS.

In the other hand, the China's database doesn't store records by Unicode but the database in U.S. does.

We wrote an application by .Net, we were try to read records from China's database by SqlDataReader ,a .Net object, and use web service method to insert the record into U.S.』s database.

However the retrieved records from China's database are scrambled character therefore, after insert it via web service, the record in the destination database is shown in scrambled character too.

We were tried to use the following 2 method to work around it but they didn't work.

Idea 1, insert the records in to a temp table with another collation first.
--------------------------------------------------------------------------------------------------------------------------
create table #temptable([Name] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL)

insert into #temptable SELECT top 10 Name FROM ChinaTable

select * from #temptable
--------------------------------------------------------------------------------------------------------------------------

Idea 2, using CAST or CONVERT function.
--------------------------------------------------------------------------------------------------------------------------
SELECT top 10 CAST ( Name AS nvarchar(100))
FROM ChinaTable

SELECT top 10
CONVERT ( nvarchar(100) , Name )
FROM ChinaTable
--------------------------------------------------------------------------------------------------------------------------

Could anyone give me any suggestion to work around it?

BTW, my machine supports to display Chinese so I think it not a displaying problem.

Thank you.

Wayne
dmoldovan
dmoldovan
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1512 Visits: 1479
See if this helps you:
http://www.sqlservercentral.com/Forums/Topic667087-145-1.aspx#bm667120
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search