Crimsonland
Crimsonland

Reputation: 2204

How to Show Eastern Letter(Chinese Character) on SQL Server/SQL Reporting Services?

I need to insert chinese characters in my database but it always show ???? ..

Example:

Insert this record.

微波室外单元-Apple

Then it became ???

Result:

??????-Apple

I really Need Help...thanks in regard.

I am using MSSQL Server 2008

Upvotes: 12

Views: 27493

Answers (5)

My Mickei
My Mickei

Reputation: 9

SELECT 'UPDATE table SET msg=UNISTR('''||ASCIISTR(msg)||''') WHERE id='''||id||''' FROM table WHERE id= '123344556' ;

Upvotes: -1

matt karp
matt karp

Reputation: 159

Make sure you specify a unicode string with a capital N when you insert like:

INSERT INTO Table1 (Col1) SELECT N'微波室外单元-Apple' AS [Col1]

and that Table1 (Col1) is an NVARCHAR data type.

Upvotes: 15

ErikE
ErikE

Reputation: 50271

Make sure the column you're inserting to is nchar, nvarchar, or ntext. If you insert a Unicode string into an ANSI column, you really will get question marks in the data.

Also, be careful to check that when you pull the data back out you're not just seeing a client display problem but are actually getting the question marks back:

SELECT Unicode(YourColumn), YourColumn FROM YourTable

Note that the Unicode function returns the code of only the first character in the string.

Once you've determined whether the column is really storing the data correctly, post back and we'll help you more.

Upvotes: 5

FosterZ
FosterZ

Reputation: 3911

Try adding the appropriate languages to your Windows locale setings. you'll have to make sure your development machine is set to display Non-Unicode characters in the appropriate language. And ofcourse u need to use NVarchar for foreign language feilds

Upvotes: 3

Delan Azabani
Delan Azabani

Reputation: 81482

Make sure that you have set an encoding for the database to one that supports these characters. UTF-8 is the de facto encoding as it's ASCII compatible but supports all 1114111 Unicode code points.

Upvotes: 0

Related Questions