piml_lv 发表于 2011-05-13 15:31

悲剧了,字符集问题? 锦江可以 如家不行啊

1> select @@version
2> go
                                                                                                                                                                                                                                                               
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Adaptive Server Enterprise/15.0.3/EBF 16555 ESD#1/P/Linux Intel/Linux 2.6.9-42.
ELsmp i686/ase1503/2680/32-bit/FBO/Thu Mar5 04:50:21 2009   


1> sp_configure 'character'
2> go
Msg 17411, Level 16, State 1:
Server 'cms', Procedure 'sp_configure', Line 291:
Configuration option is not unique.

Parameter Name               Default   Memory Used Config Value
Run Value    Unit               Type      
------------------------------ ----------- ----------- ------------
------------ -------------------- ----------
default character set id               1         0          190
          190 id                   static   
disable character set conversi         0         0            0
            0 switch               static   
(1 row affected)
(return status = 1)
1> sp_configure 'sort'
2> go
Msg 17411, Level 16, State 1:
Server 'cms', Procedure 'sp_configure', Line 291:
Configuration option is not unique.

Parameter Name               Default   Memory Used Config Value
Run Value    Unit               Type      
------------------------------ ----------- ----------- ------------
------------ -------------------- ----------
default sortorder id                  50         0         52
         52 id                   static   
default unicode sortorder         binary         0       binary
       binary name               static   
default xml sortorder               binary         0       binary
       binary name               static   
enable sort-merge join and JTC         0         0            0
            0 switch               dynamic   
number of sort buffers               500         0          500
          500 number               dynamic   
(1 row affected)
(return status = 1)

1> insert into cs_test values('b如家a')
2> go
(1 row affected)
1> insert into cs_test values('a如家b')
2> go
(1 row affected)
1> insert into cs_test values('如家')
2> go
Msg 105, Level 15, State 2:
Server 'cms', Line 1:
Unclosed quote before the character string '如家')
'.
Msg 102, Level 15, State 1:
Server 'cms', Line 1:
Incorrect syntax near '如家')
'.
1> insert into cs_test values("如家")
2> go
Msg 105, Level 15, State 2:
Server 'cms', Line 1:
Unclosed quote before the character string '如家")
'.
Msg 102, Level 15, State 1:
Server 'cms', Line 1:
Incorrect syntax near '如家")
'.
1> insert into cs_test values("如家c")
2> go
(1 row affected)
1> select * from cs_test
2> go
name
--------------------
锦江
锦江
A锦江
a锦江
B锦江
b锦江
a如家a
b如家a
a如家b
如家c
(10 rows affected)

piml_lv 发表于 2011-05-13 15:33

1> insert into cs_test values ('格林')
2> go
Msg 105, Level 15, State 2:
Server 'cms', Line 1:
Unclosed quote before the character string '格林')
'.
Msg 102, Level 15, State 1:
Server 'cms', Line 1:
Incorrect syntax near '格林')
'.
1> insert into cs_test values ('锦江')
2> go
(1 row affected)
1> select * from cs_test
2> go
name               
--------------------
锦江               
锦江               
A锦江               
a锦江               
B锦江               
b锦江               
a如家a               
b如家a               
a如家b               
如家c               
锦江               

(11 rows affected)

Eisen 发表于 2011-05-13 16:31

版本太低了吧。先装ESD#4吧

alanzhu 发表于 2011-05-15 20:22

用ASE15.5做测试,没有发现问题。
应该与客户端配置有关。在测试时,把客户端强制设成UTF8(即default character set id=190)就会出类似的问题。

hobbylu 发表于 2011-05-16 11:26

光看名字还以为是广告呢

piml_lv 发表于 2011-05-17 12:50

找到原因了
不只是需要server、 client 字符集设置utf-8
还需要终端(xmanager)设置UTF8

{:3_183:}
页: [1]
查看完整版本: 悲剧了,字符集问题? 锦江可以 如家不行啊