如何在SQLExpress文本字段中插入汉字? [英] How do I insert Chinese characters into a SQLExpress text field?

查看:185
本文介绍了如何在SQLExpress文本字段中插入汉字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在SQLExpress文本字段中插入汉字?我使用VS 2008的SQL Express。当我添加汉字,通过我写的一个导入应用程序或通过粘贴他们在Visual Studio中的数据视图,他们最终作为问号。

$ b $在nchar / nvarchar / ntext类型的字段的INSERT / UPDATE语句中,在文本分隔符之前添加一个N:

$

b
$ b

INSERT INTO myTable(myField1,myField2)VALUES(N'any chinese character',N'any arabic character')


How do I insert Chinese characters into a SQLExpress text field? I'm using SQL Express from VS 2008. When I add Chinese characters, either via an import app I wrote or by pasting them in from the data view inside Visual Studio, they end up as question marks.

解决方案

Just add an 'N' before your text delimiter in the INSERT/UPDATE statement for fields of the nchar/nvarchar/ntext type:

INSERT INTO myTable (myField1, myField2) VALUES (N'any chinese character',N'any arabic character')

这篇关于如何在SQLExpress文本字段中插入汉字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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