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

UNICODE in MSSQL 7

Status
Not open for further replies.

goofy

Programmer
Feb 3, 2001
30
0
0
US
Hi,

How to store non English(Chinese, Japanese, Korean) in SQL Database

 
I've never had to do this, so I may not have the whole answer. But at least to start with, you need to use column datatypes that can store international characters. For example, instead of char() and varchar(), you will be using nchar() and nvarchar(). These datatypes can store non-English characters, but to do so they consume two bytes per character instead of just one.

Also, read these topics in BooksOnLine:
- SQL Language Support
- Unicode Data
- Using Unicode Data
 
Another tip - when storing your Unicode data in the nchar and nvarchar columns, you should prefix any constant strings with an "N" (must be capital) to let the SQL parser know that the data is Unicode.
Code:
  Update Customer
  Set LastName = N'ﺸﺵﻄﻁﻀ'
  Where CustomerID = 345

Chip H.
 
thanks a lot for your responses..
i had already gone thru msdn, and books online......

The data type is nvarchar
My issue is especially with Chinese & Japanese... other languages are working fine...

My issues are
1. I tried inserting value using query analyzer saying
INSERT INTO test VALUES(N'½á¹û')
Ultimately it ended up adding "NULL". And the chinese characters were displayed as junk in the insert statement itself

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top