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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AN question about Chinese Character

Status
Not open for further replies.

soyo20

IS-IT--Management
Jan 5, 2003
9
CN
When I use SQL Server to treat Chinese Character,I notice that the server treat one charactor as 1 of the string length, If I had a string of 5 Chinese Character, the length of the string is 5. This is different with the past method. In past time on DOS system, one Chinese Character was 2 bytes. That is to say the string length of 5 Chinese Character is 10. I need the SQL Server to treat Chinese Character in this way. How can I config it?
 
How are you determining the string length? If you use Unicode (NCHAR, NVARCHAR, NTEXT), the character set will be double byte. The number of characters will be 5 but the number of bytes will be 10. In T-SQL you can use the LEN function to determine the number of characters and the DATALENGTH function to determine the number of bytes. Terry L. Broadbent - DBA
SQL Server Page:
If you want to get the best answer for your question read faq183-874.
 
Thank you for your advice. I have resolved my problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top