[英]SQL Server 2000 DTS - Cannot resolve collation conflict for equal to operation
I have a SQL Server 2000 DTS package. 我有一个SQL Server 2000 DTS程序包。
One of the steps of this package has the following SQL: 该软件包的步骤之一具有以下SQL:
SELECT *
FROM [Crocus_Limited$OrderRequestDetail]
WHERE (rep_updated > GETDATE() -2)
AND NOT EXISTS
(SELECT OrderID
FROM NavisionUpgrade.navision4.dbo.[WEBOrderDetails] rd
WHERE rd.OrderID = [Crocus_Limited$OrderRequestDetail].OrderID
AND rd.NavisionItemNo = [Crocus_Limited$OrderRequestDetail].NavisionItemNo )
It is failing- giving me error: cannot resolve collation conflict for equal to operation. 它正在失败-给我错误:无法解决等于操作的排序规则冲突。
This DTS basically moves data from one DB to another (located in different geographical locations) 此DTS基本上将数据从一个DB移动到另一个DB(位于不同的地理位置)
how can i alter the above query to resolve this? 我该如何更改以上查询来解决此问题?
One or both of your join columns has on of the char datatypes (char,nchar,varchar,nvarchar) which is stored in incompatible collations in each database. 您的一个或两个连接列都具有一个char数据类型(char,nchar,varchar,nvarchar),这些数据类型存储在每个数据库的不兼容排序规则中。
You can specify the collation to use in any string comparison. 您可以指定在任何字符串比较中使用的排序规则。 The easiest way to do it is to specify the default collation of the machine on which the query is running (I'm guessing that NavisionItemNo
is the problem column): 最简单的方法是指定运行查询的计算机的默认排序规则(我猜NavisionItemNo
是问题列):
...AND rd.NavisionItemNo collate database_default = [Crocus_Limited$OrderRequestDetail].NavisionItemNo collate database_default )
EDIT 编辑
Is OrderID a varchar column too? OrderID也是varchar列吗? If so, try 如果是这样,请尝试
...WHERE rd.OrderID collate database_default = [Crocus_Limited$OrderRequestDetail].OrderID collate database_default
AND rd.NavisionItemNo collate database_default = [Crocus_Limited$OrderRequestDetail].NavisionItemNo ) collate database_default
as the two former posts mention you have to use the collate attribute to every nonumeric column but have a look a the collation of the target db and use this collation (eg SQL_Latin_CI_AS). 如前两篇文章所述,您必须对每个非数字列使用collate属性,但要查看目标数据库的排序规则并使用该排序规则(例如SQL_Latin_CI_AS)。 Be aware that a table can have it's own collation even a column can have annother collation, so have a deep look in your definitions. 请注意,表甚至可以具有自己的归类,甚至一列也可以具有另一个归类,因此请对定义进行深入了解。
Peace and good luck Ice 和平与好运冰
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.