Help - Collation Conflict

Asked

Viewed 379 times

0

Srs(as), good afternoon,

Could help me identify a problem?

I am changing a PROC and when testing it is occurring the following error:

Cannot resolve the collation Conflict between "Sql_latin1_general_cp1_ci_as" and "Latin1_general_ci_as" in the Equal to Operation.

I checked the Collate settings of the bases where the JOINS are made and both are equal:

SQL_Latin1_General_CP1_CI_AS

The only difference is that some columns have no definition of Collate
Ex.: [Column_Name] [Data_Type] Collate NULL

Other than that no other difference.

Could someone help?

  • 1

    Put the tag of the database you are using.

1 answer

2


You say the two databases (databases) have the collation, most likely then is that the columns you are using in your query, have a collation different from the default database.

In any case you can adjust your instruction as follows to overcome the problem:

SELECT ID
FROM tbl_a a
INNER JOIN tbl_b b
   ON a.campo1 = b.campo1 COLLATE database_default
WHERE a.campo2 = 'xpto'

OR

SELECT ID
FROM tbl_a a
INNER JOIN tbl_b b
   ON a.campo1 = b.campo1 COLLATE SQL_Latin1_General_CP1_CI_AS
WHERE a.campo2 = 'xpto'
  • Bruno, thanks for the help, it worked perfectly. However I would like to understand why this occurred, and there is no different Collate from the standard stipulated in the Base, when it is like NULL.

  • @Luizmartinez, if this has solved your problem, you can mark this answer as the correct one. In addition to giving credit where credit is due, you also help other people who have the same question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.