Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

chinese characters in 2005 version of sql

Status
Not open for further replies.

ktb916

Programmer
Jan 22, 2004
76
US
I have an SQL db hosted on godaddy. I need some of my table fields to handle both English and Chinese characters. I have imported some table data with both languages but the Chinese shows up as a bunch of (??????) question marks. Is there a setting I'm missing to make this work? My fields are all text.
 
My fields are all text.

Do you mean that the data type for the columns is Text? If so, that's a problem. The Text data type does not support the Chinese language. You need to use NText instead. Since you are using SQL2005, I would actually encourage you to stop using Text and nText and use varchar(max) and nvarchar(max).

you can store gigabytes of data in an nvarchar(max) column, and it supports unicode characters so it can store Chinese characters.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Thanks George. I tried NText because I am using an access frontend and I'm afraid changing the data type to an nvarchar will blow up my queries and reports. I still get the ??? with the NText so I'm going to try the nvarchar anyway and see what happens
 
Rest assured that ntext and nvarchar can store Chinese character.

The problem you are experiencing could be explained several different ways. It could be that your unicode data is getting converted to ASCII during the import so that you are not actually getting the data you expect in the table. It's also possible that the data is getting converted to ASCII when you read it from the table.

I would encourage you to double check these things. The simplest way to do this is to use SQL Server Management Studio (SSMS). If you select a row of data that you know has Chinese characters, you should see them in the result tab of SSMS. If you don't see the characters, then the problem is when you load the data in to the table. If you DO see Chinese characters, then the problem is when you read the data from the table.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
nvarchar worked - not sure why ntext didn't - maybe operator error. Thanks for the help!
 
One more question - I need a quick way to append data to my sql db on the web. Using an append query in Access takes litterally hours. Any ideas?
 
Let me see if I understand...

You have a database hosted on the internet with godaddy.
You are using Access as a front end that connects to the database.
You now want to import data in to the database.

How much data are you talking about? 100's of rows, 1000's, millions of rows?

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
I'm dealing with about 5,000 rows of data right now but I expect that number could grow to 50,000 at some point.
 
Sorry - also you are right on all points you listed above...

db hosted on godaddy
Access front end
Import data to the db on the web

 
Unfortunately, I don't have any experience uploading data to a hosted database, or Access. This puts me at a disadvantage for answering your question. Sorry.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
OK - You've been a big help regardless!

Thanks
 
I'm not familiar with Access either, but you talk about using append, isn't there an INSERT option?

How many rows exist in the database and is there an index?

If it's a very large number of rows and there is an index, that could be causing slowness. You could try dropping the index, inserting the data, then reapplying the index.

Another thing to check is what is the autogrowth of the database set for? It might be a very small number which would cause the database files to have to grow multiple times. That in turn would slow down the work.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top