1

我正在尝试跨两个链接服务器编写查询。使用适当的登录设置链接后,我收到此整理错误:

无法解决等于操作中“SQL_Latin1_General_CP1_CI_AS”和“Latin1_General_CI_AS”之间的排序规则冲突。

这对我来说是新的,但它看起来像一个字符集冲突,所以我用谷歌搜索它并发现了可以添加到我的加入的 collat​​e 命令。但是我都试过了

va ON V_ID1 = c1.strData COLLATE Latin1_General_CI_AS

va ON V_ID1 = c1.strData COLLATE SQL_Latin1_General_CP1_CI_AS

而且似乎都没有解决错误。我究竟做错了什么?

编辑:整个查询太大而无法发布并期望人们过滤,但这里是相关位:

   select
        rel.intParentAttributeId as intItemId,
        case va.type
        when 'SM' then 120000000
        when 'FB' then 110000000
        when 'RO' then 100000000
        when 'SP' then 90000000
        when 'A' then 80000000
        when 'D' then 70000000
        when 'P' then 60000000
        when 'SR' then 50000000
        when 'FN' then 40000000
        when 'RL' then 30000000
        when 'VO' then 20000000
        when 'RE' then 10000000
        end
        +

        rel.intParentAttributeId
        as fltStrength
        from
        AttributeMap ky

        join Catalogue c1 on c1.intRowId=ky.intChildAttributeId and c1.intAttributeTypeId=@intsimilarAtt

        join

        [SQLSERVERNAME].[SchemaName].dbo.VidAssc
         va on V_ID1 COLLATE SQL_Latin1_General_CP1_CI_AS = c1.strData COLLATE SQL_Latin1_General_CP1_CI_AS


        join Catalogue c2 on c2.strData=V_ID2 and c2.intAttributeTypeId=@intsimilarAtt

        join AttributeMap rel on rel.intChildAttributeId = c2.intRowId

        join @tmpSeeds s on s.intItemId = ky.intParentAttributeId

        group by rel.intParentAttributeId,va.Type

        )sqi

干杯,马特

4

2 回答 2

2

尝试将COLLATE也放在左侧:

FROM Table1 AS t1
INNER JOIN Table2 AS t2
 ON t1.ID COLLATE Latin1_General_CI_AS
  = t2.ID --COLLATE Latin1_General_CI_AS --optionally on the right if needed.
于 2011-04-11T16:41:01.793 回答
2

好的,终于找到了解决办法。这是你必须做的:

在 sql server manager 到 Server Objects > Linked Servers > 并找到有问题的链接服务器。

右键单击>属性

在服务器选项下,将“使用远程排序规则”设置为“False”,将“排序规则名称”设置为“Latin1_General_CI_AS”

于 2011-04-12T09:23:39.640 回答