1 系统安装东亚语言支持包 2 查询分析器里支持Unicode解析 3 alter collate更改数据库编码 提供中文语言翻转 4 存储中文的字段需N类型
Alter database 数据库名称 Collate Chinese_PRC_BIN 修改数据库默认字符集
ALTER DATABASE 数据库名 COLLATE 排序规则名
不行 执行 alter database pc_plus Collate Chinese_PRC_BIN 失败,提示: Server: Msg 5030, Level 16, State 2, Line 1 The database could not be exclusively locked to perform the operation. Server: Msg 5072, Level 16, State 1, Line 1 ALTER DATABASE failed. The default collation of database 'pc_plus' cannot be set to Chinese_PRC_BIN.
先alter database db_name set single_user with rollback immediate go
按照楼上的方法执行后,出线下面错误 Server: Msg 5075, Level 16, State 1, Line 2 The column 'BMS_ISSUE_AUD.issue_amt' is dependent on database collation. Server: Msg 5075, Level 16, State 1, Line 2 The column 'BMS_SVC_REQUEST.Amount' is dependent on database collation. Server: Msg 5075, Level 16, State 1, Line 2 The column 'BMS_ISSUE.issue_amt' is dependent on database collation. Server: Msg 5075, Level 16, State 1, Line 2 The object 'CK_BMS_ISSUE' is dependent on database collation. Server: Msg 5075, Level 16, State 1, Line 2 The column 'BMS_ISSUE_SVC_DS.issue_amt' is dependent on database collation. Server: Msg 5075, Level 16, State 1, Line 2 The column 'BMS_SO_PLAN.remain_qty' is dependent on database collation. Server: Msg 5072, Level 16, State 1, Line 2 ALTER DATABASE failed. The default collation of database 'db_bms' cannot be set to Chinese_PRC_BIN.
2 查询分析器里支持Unicode解析
3 alter collate更改数据库编码 提供中文语言翻转
4 存储中文的字段需N类型
Server: Msg 5030, Level 16, State 2, Line 1
The database could not be exclusively locked to perform the operation.
Server: Msg 5072, Level 16, State 1, Line 1
ALTER DATABASE failed. The default collation of database 'pc_plus' cannot be set to Chinese_PRC_BIN.
go
Server: Msg 5075, Level 16, State 1, Line 2
The column 'BMS_ISSUE_AUD.issue_amt' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 2
The column 'BMS_SVC_REQUEST.Amount' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 2
The column 'BMS_ISSUE.issue_amt' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 2
The object 'CK_BMS_ISSUE' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 2
The column 'BMS_ISSUE_SVC_DS.issue_amt' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 2
The column 'BMS_SO_PLAN.remain_qty' is dependent on database collation.
Server: Msg 5072, Level 16, State 1, Line 2
ALTER DATABASE failed. The default collation of database 'db_bms' cannot be set to Chinese_PRC_BIN.
----------
你是说 同样的查询 在服务器上显示乱码 在客户端查询出来就是正常的?---------------------------------------------------------------
是这样的
只要中文字段是以nchar、nvarchar来存储的 英文collate下可以正常work
-----------------------------------------------------------------
改成nchar 和 nvarchar 了, 还是乱码
你服务器上有安装中文语言包没?你刚改的还是原来就是这种类型?
--------------------------------------------------------
刚改的
从char/varchar改成nchar/nvarchar 只是扩大了字符的存储空间 不能识别的字符仍然不会被识别