SQL Server 数据插入时,排序规则冲突

发布于 2019年07月02日 01:54:54 - 技术分享 - 数据库 - SQL-Server

提示以下问题出现:

insert into DB002.dbo.TX(SD,ED) SELECT FromD,EndD FROM DB001.dbo.A_Mid 
where BO not in (select BO from DB002.dbo.TX)  
在执行以上语句是提示错误: Msg 468, Level 16, State 9, Line 1
Cannot resolve the collation conflict between "Compatibility_198_804_30001" and "Chinese_PRC_CI_AS" in the equal to operation.(消息468,级别16,状态9,行1无法解析“Compatibility_198_804_30001”和“Chinese_PRC_CI_AS”等于在操作之间的排序规则冲突。)

可以尝试这样解决:

insert into DB002.dbo.TX(SD,ED) 
SELECT FromD,EndD 
FROM DB001.dbo.A_Mid 
where BO COLLATE  Chinese_PRC_CI_AS not in (select BO  COLLATE  Chinese_PRC_CI_AS  from DB002.dbo.TX)  

感谢:https://bbs.csdn.net/topics/370240414 

转载声明:本站文章无特别说明,皆为原创,版权所有,转载请注明:Dy大叔的日常

转载自 SQL Server 数据插入时,排序规则冲突 | XDY.ME@Dy大叔的日常

XDY.ME@Dy大叔的日常