Tuesday, 5 May 2015

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.


How to check the collation

  SELECT
    col.name, col.collation_name
FROM
    sys.columns col
WHERE
    object_id = OBJECT_ID('User')


Solution:

SELECT ID
FROM UserMapping
INNER JOIN User
WHERE UserId COLLATE DATABASE_DEFAULT
= UserMappingUserID COLLATE DATABASE_DEFAULT

No comments:

Post a Comment