解決:無法解析 equal to 作業中 "Chinese_Taiwan_Stroke_CI_AS" 與 "Chinese_PRC_CI_AS" 之間的定序衝突

最近在使用连接服务器跨数据库查询数据的时候出现一下问题:

無法解析 equal to 作業中 "Chinese_Taiwan_Stroke_CI_AS" 與 "Chinese_PRC_CI_AS" 之間的定序衝突


很明显是繁体数据库和简体数据库之间的冲突。

例如:

select top 50 workno,CName,sex, simname,convert(varchar(10),effectday,120) 
effectday from [10.129.97.218].[hrms_db_20120319].dbo.vw_employee  WHERE  
lastdimidate is  null and workno like '%' and simname like '%%'  and workno 
not like 'T%' and workno  not in (select EmployeeCode from hr_EmployeeOnDuty 
where EmployeeOrderID ='ZM2012030028') order by workno desc


 [10.129.97.218].[hrms_db_20120319].dbo.vw_employee 为简体SQL2005

hr_EmployeeOnDuty  为繁体SQL2005


解决方法:

select top 50 workno,CName,sex, simname,convert(varchar(10),effectday,120) 
effectday from [10.129.97.218].[hrms_db_20120319].dbo.vw_employee  WHERE  
lastdimidate is  null and workno like '%' and simname like '%%'  and workno 
not like 'T%' and workno  COLLATE Chinese_Taiwan_Stroke_CI_AS not in (select EmployeeCode from hr_EmployeeOnDuty 
where EmployeeOrderID ='ZM2012030028') order by workno desc


加上红色关键字即可以解决。



你可能感兴趣的:(MSSQL)