我遇到此错误的问题
“无法在等于操作的情况下解决”SQL_Latin1_General_CP1_CI_AS“和”Latin1_General_CI_AS“之间的排序规则冲突。”在SSMS。
我知道这意味着我的列没有相同的排序规则,我已经查找了解决方案,并尝试更改排序规则。它们都具有相同的排序规则,但我仍然得到相同的错误。
我该如何解决? 这是我的剧本:
`INSERT INTO EVoucherBatchMapping_New(EVoucherBatchValidityID,
EventCode,
ArrivalDate,
DepartureDate,
NoShowCharge)
SELECT EVoucherBatchValidityID,
EventCode,
ArrivalDate,
DepartureDate,
NoShowCharge
FROM EVoucherBatchMapping
WHERE ArrivalDate BETWEEN '2015-01-01' AND GETDATE()
AND EXISTS(SELECT * FROM PromotionEvent_New where EVoucherBatchMapping.EventCode = PromotionEvent_New.EventCode) `
答案 0 :(得分:0)
您可以更改列定义以使用相同的排序规则,或者在子查询中提供要使用的排序规则:
SELECT * FROM PromotionEvent_New
WHERE
EVoucherBatchMapping.EventCode = PromotionEvent_New.EventCode
COLLATE SQL_Latin1_General_CP1_CI_AS;
或
SELECT * FROM PromotionEvent_New
WHERE
EVoucherBatchMapping.EventCode = PromotionEvent_New.EventCode
COLLATE Latin1_General_CI_AS;