Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_

Posted by Patrick Olurotimi Ige on Geeks with Blogs See other posts from Geeks with Blogs or by Patrick Olurotimi Ige
Published on Fri, 30 Apr 2010 05:34:52 GMT Indexed on 2010/04/30 5:47 UTC
Read the original article Hit count: 509

Filed under:

I was writing a store proc for a report and i needed some data from another server
so i added a linked server to connect to this new db server.

when i do a select like below its all fine

select a,b,c from Server.DatabaseName.dbo.table

But when i use the table in a join i get the error

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

I did check the collation set on the 2 databases and it was actually the same and had mo idea why i'm getting the error.

I later found out that you could specifically tell it to use a COLLATE
Just rewrite your join like this

on a.name COLLATE Latin1_General_CI_AS = eaobjname

Hope that helps and saves your precious time
Patrick

 

© Geeks with Blogs or respective owner