我正在嘗試在兩個鏈接的服務器上編寫查詢。已經設立具有適當的登錄鏈接,我得到這個整理錯誤:如何在T-SQL中正確構造collate命令?
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
這是新的給我,但它看起來像一個字符集衝突,所以我用Google搜索,並發現了分頁打印指令從而可以被添加到我的加入。但是我都試過
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 [email protected]
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 [email protected]
join AttributeMap rel on rel.intChildAttributeId = c2.intRowId
join @tmpSeeds s on s.intItemId = ky.intParentAttributeId
group by rel.intParentAttributeId,va.Type
)sqi
乾杯, 馬特
你能請張貼整個查詢?那裏可能有些東西你認爲是理所當然的。 – 2011-04-11 16:30:40