Result 表中 test_number 的字符编码为:Latin1_General_CI_AS_WS
Name 的字符编码为:Latin1_General_CS_AS_WS
如果直接相加则会出现下面的异常:
select test_number + name from result
Msg 457, Level 16, State 1, Line 2
Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict.
解决的办法为:
用下面的sql
select test_number + name collate Latin1_General_CI_AS_WS from result