sql server 插入汉字问题

SQL SERVER 2005 比SQL SERVER 2000增加了很多新特性,我没仔细研究就开始使用SQL SERVER 2005了。遇到的问题还真不少。

SQL SERVER2005中发现不能用vachar()存汉字了(SQL SERVER 2000创建的数据库导入SQL SERVER 2005除外),改用ncachar()了,但写起程序的时候,发现插入的汉字都变成了??,直接用T-SQL语句执行插入,也是一样,在管理器中直接插 入却可以显示汉字。

解决:T-SQL语句中在要要存储的字符前加上N。
如:insert into 表名 (字段名) values(N”內容”);

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)