Sql server中Collation conflict问题

SQL语句查询时
select A.Code,A.Name,a.Systemcode,B.ID,B.LogType,B.DMCode,B.IP,B.Department,B.CreateBy,B.CreateTime
from DM_Document_TD as A left join DM_LOG_TD as B
on A .Code=B .DMCode

结果在运行时碰到这样一个问题,问题描述:
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Chinese_PRC_CI_AS" in the equal to operation.
到网上搜了一下,了解了问题产生的原因,原来是两个数据库的collation不一致导致的,将查询语句改成如下:

select A.Code,A.Name,a.Systemcode,B.ID,B.LogType,B.DMCode,B.IP,B.Department,B.CreateBy,B.CreateTime
from DM_Document_TD as A left join DM_LOG_TD as B
on A .Code collate chinese_prc_ci_as =B .DMCode

原文地址:https://www.cnblogs.com/ahao214/p/3243582.html