如何从存储过程中插入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[^]