将非英语数据插入Sql server 2008 [英] Insert non-English data into Sql server 2008

查看:67
本文介绍了将非英语数据插入Sql server 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用我的C#应用​​程序将非英语(Kannada特定)数据插入sql-server数据库....



如何插入并从sql-server检索unicode数据... ???

谢谢,

I need to insert non-English (Kannada to be specific) data into sql-server database using my C# application....

How can i insert and retrieve unicode data from sql-server...???
Thank you,

推荐答案

hi



您无法在非unicode列中存储unicode数据。所以你必须将unicode数据存储为nvarchar



hi

You can not store unicode data in non unicode column. So you will have to store unicode data as nvarchar

DECLARE @Hindi varchar(64)
SET @Hindi = 'धन्यवाद'

DECLARE @nHindi nvarchar(84)
SET @nHindi = N'धन्यवाद'

SELECT @Hindi, @nHindi
In the above example when   'धन्यवाद' (Thank you in Hindi) stored as varchar it displays as ????? in the query editor.







或者我认为它可以肯定地帮助你......

谢谢



[来自第二个解决方案 - 同一作者]

hi



i认为它可以帮到你....



SQL中的Unicode数据类型 [ ^ ]



thanks




or i think it may definetly helps you....
thanks

[From 2nd solution - same author]
hi

i think it may helps you....

Unicode Data Type in SQL[^]

thanks


SQL Server支持具有 nvarchar 数据类型的unicode字符,因此您需要做的就是将表列定义更改为此数据类型。



注意:如果你确实要加倍你想要的大小,因为unicode是2个字节,例如你需要 varchar(20)你应该使用 nvarchar(40)
SQL Server supports unicode characters with the nvarchar data type, so all you need to do is change your table column definitions to this data type.

Note: that if you do make sure you double the size you want since unicode is 2 bytes, for example if you need varchar(20) you should use nvarchar(40).


这篇关于将非英语数据插入Sql server 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆