Help - Conflict of Collation

0

Sirs, good afternoon,

Could you help me identify a problem?

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

  

Can not resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the same to operation.

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

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

No other difference.

Could someone help?

    
asked by anonymous 10.07.2015 / 16:43

1 answer

2

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

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'
    
10.07.2015 / 17:14