如何从存储过程中插入sql server 2008中的unicode字符 [英] How to insert unicode character in sql server 2008 from stored procedure

查看:292
本文介绍了如何从存储过程中插入sql server 2008中的unicode字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

How to insert unicode character in sql server 2008 from stored procedure







我试图插入但是得到?????




I am trying to insert but getting ?????

推荐答案

出现在服务器上执行的代码中的Unicode字符串常量,例如存储过程和触发器,必须以大写字母N开头。即使被引用的列已经定义为Unicode,也是如此。如果没有N前缀,则字符串将转换为数据库的默认代码页。这可能无法识别某些字符

例如 EXECUTE Product_Info @name = N'Chain'



Link 服务器 - 使用Unicode编程 [ ^ ]
"Unicode string constants that appear in code executed on the server, such as in stored procedures and triggers, must be preceded by the capital letter N. This is true even if the column being referenced is already defined as Unicode. Without the N prefix, the string is converted to the default code page of the database. This may not recognize certain characters."
E.g. EXECUTE Product_Info @name = N'Chain'

Link Server-Side Programming with Unicode[^]


这篇关于如何从存储过程中插入sql server 2008中的unicode字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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