Import chinese charachters using CPDTS.DLL

Dear Lord! I've been working on a DTS importing chinese data from a SQL Server 2000 in China to a SQL Server 2000 in Europe. The clue was that the folks in Europe must be able to see the chinese characters...

Two important things are needed to accomplish this task:

  1. The client pc where the chinese characters are read must have the asian language pack installed for Windows
  2. The characters need to be converted from codepage 936 to 1250 (depending on the code page of course)

Chinese Simplified (EUC) 51936
Chinese Simplified (GB2312) 936
Chinese Simplified (HZ) 52936
Chinese Simplified (Mac) 10008
Chinese Traditional (Big5) 950
Chinese Traditional (CNS) 20000
Chinese Traditional (Eten) 20002
Chinese Traditional (Mac) 10002

As far as I know, there is only one way to do it. Please do leave a comment if you think you have a better solution.
A certain DLL should be installed on your SQL Server: CPDTS.DLL. Read all about it on http://www.microsoft.com/middleeast/msdn/CPDTS.aspx

The procedure is quite straight forward and it tends to work but I was unlucky. A chinese woman almost wet her pants when she noticed the chinese characters were 90 degrees rotated....

I still don't have a solution to this problem but I've found a quick workaround:

  1. Register the chinese server and your local server in Management Studio (Yes, Management Studio. Not Enterprise Manager)
  2. Import or export data from one database to the other database

So, why using the DLL? I noticed unreadable text when I performed a select * from [the table on the chinese server] in Enterprise Manager. Then I ran the same query in Management Studio and I was amazed to see chinese charachters. I've set up a simple data pump but do keep in mind using unicode datatypes in the destination table. And amazingly the destination table also showed chinese characters and don't even have the asian language pack for Windows installed!

I hope it comes in handy for someone dealing with chinese data

Steve

Published Wednesday, June 13, 2007 9:25 PM by Steve
Filed under: