Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

scrambled character issue Expand / Collapse
Author
Message
Posted Tuesday, March 10, 2009 9:45 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 1, 2010 2:58 AM
Points: 6, 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
Post #672971
Posted Wednesday, March 11, 2009 8:04 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, December 21, 2014 1:10 AM
Points: 365, Visits: 1,342
See if this helps you:
http://www.sqlservercentral.com/Forums/Topic667087-145-1.aspx#bm667120
Post #673270
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse