开发者

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.

微波室外开发者_StackOverflow社区单元-Apple

Then it became ???

Result:

??????-Apple

I really Need Help...thanks in regard.

I am using MSSQL Server 2008


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.


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.


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


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.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜