| varchar类型的字段如何存储中文(SQL Server 2008/2008 R2/2012) |
当Varchar类型字段的Collation属性设置为Latin_General时,insert或者update中文时,不能正常存储,显示为问号。 UQLLWK http://blog.numino.net/ 只有修改为collation属性为如下之一: 3s5307 http://blog.numino.net/ Chinese_PRC_Stroke_90_BIN Oe19gM http://blog.numino.net/ Chinese_PRC_90_CI_AS FvR6eV http://blog.numino.net/ 同时,insert或者update时,把汉字值使用unicode标示符进行转换。 to0T9d http://blog.numino.net/ 例如,N'中文', o9w4X8 http://blog.numino.net/ INSERT INTO [dbo].[tbName] ([bb]) VALUES (N'中文xx') 1So6aE http://blog.numino.net/ varchar类型字段才能够正常存储并显示汉字
|
|