Sql字符集排序规则不一致

来源:互联网 发布:林子方 知乎 编辑:程序博客网 时间:2024/05/29 09:27

今天在连接查询两个表时,总是提示

Cannot resolve the collation conflict between "Chinese_PRC_CI_AS" and "Chinese_Taiwan_Stroke_CI_AS" in the equal to operation


这时只需统一一下要比较的两个字段的字符排序规则即可

列:select * 
from A 
where exists 
(
select * 
from B
where A.Link_Id = B.link_id and charindex(A.link_ids collate Chinese_Taiwan_Stroke_CI_AS,B.link_ids collate Chinese_Taiwan_Stroke_CI_AS) > 0 

 )

0 0
原创粉丝点击