March 10, 2009 at 9:45 pm
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
March 11, 2009 at 8:04 am
See if this helps you:
http://www.sqlservercentral.com/Forums/Topic667087-145-1.aspx#bm667120
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply