无法解决 equal to 操作中 "Chinese_PRC_CI_AS" 和 "Chinese_PRC_BIN" 之间的排序规则冲突

事例:

select jiaban_sq_z_01 from oa..jiaban_sq_z_01 where cundang='完成' and jbrq>='2011-01-01' and
jiaban_sq_z_01002 not in (
select danhao from hh..kq_jb_qj
)


这是因为数据库 oa 和 hh 的编码格式不一样导致的


改为:

select jiaban_sq_z_01002 from oa..jiaban_sq_z_01 where cundang='完成' and jbrq>='2011-01-01' and
jiaban_sq_z_01002 collate Chinese_PRC_CI_AS not in (
select danhao from hh..kq_jb_qj
)

即可

 

又例:

update a set a.card_no = b.newcardno from
 (select * from td_outhead where card_no <> '') a,
 (select * from card_temp where newcardno <> '') b
where a.card_no = b.cardno

改为

update a set a.card_no = b.newcardno from
 (select * from td_outhead where card_no <> '') a,
 (select * from card_temp where newcardno <> '') b
where a.card_no = b.cardno  collate Chinese_PRC_CI_AS

 

 

你可能感兴趣的:(SQL,Server)