運行此腳本時出現以下錯誤。我試過使用以下內容: COLLATE Latin1_General_CI_AS。請問可以分類嗎?由於將varchar值隱式轉換爲varchar - 比較衝突
消息457,級別16,狀態1,行不能因排序規則衝突
DECLARE @AccountID INT
SET @AccountID = 12
SELECT TOP 1 ac.AccountID,
co.Email,
ao.AccountOptionID
FROM CRM.acc.Account ac
INNER JOIN CRM.[profile].[Profile] pr
ON pr.ProfileID = ac.ProfileFK
INNER JOIN CRM.[profile].Contact co
ON pr.ProfileID = co.ProfileFK
LEFT JOIN CRM.acc.[AccountOption] ao
ON ao.AccountFK = ac.AccountID
LEFT JOIN (
SELECT OptionID
FROM CRM.acc.[Option]
WHERE [Name] = 'SMS messages') op
ON op.OptionID = ao.OptionFK
WHERE ac.AccountID = @AccountID
UNION ALL
SELECT u.UnsubscribeID,
u.EmailAddress,
u.SentEmailFK
FROM Email.dbo.Unsubscribe u
INNER JOIN (
SELECT CASE
WHEN AccountTypeFK = 2 THEN OnlineBillingEmail
ELSE EmailBillingEmail
END [EmailAddress]
FROM CRM.acc.Account
WHERE AccountID = @AccountID
) ace
ON ace.EmailAddress COLLATE DATABASE_DEFAULT = u.EmailAddress COLLATE DATABASE_DEFAULT
WHERE ISNULL(ace.EmailAddress, '') != ''
什麼是你的數據庫默認排序? – AnandPhadke
COLLATE Latin1_General_CI_AS –
對於DB'Email'= Latin1_General_CI_AS和DB'CRM'= Latin1_General_CI_AS –