1

I try to join two tables from different SQL servers. I made a LikndedServer, it takes the data from that server, but when I do 'inner join' with a table from another Db is shows this error : Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation

The query is like below:

select * from [DB1].[dbo].[Employee] as P1 
inner join [LinkedWebServer].[DB2].[dbo].[View_HyrjeDalje_Punetoret] as P2 on
 P1.[Personal_No] = P2.[vcNumriPersonal]

Thank You!

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
Ingis
  • 25
  • 6
  • 2
    Hint: `COLLATE`. – Gordon Linoff Dec 05 '18 at 14:52
  • You have to decide which collation to use in the comparison. This kind of error indicates inconsistent table design. – jarlh Dec 05 '18 at 14:52
  • Possible duplicate of [How to use the COLLATE in a JOIN in SQL Server?](https://stackoverflow.com/questions/39300955/how-to-use-the-collate-in-a-join-in-sql-server) – S3S Dec 05 '18 at 15:11

1 Answers1

0

select * from [DB1].[dbo].[Employee] as P1 inner join [LinkedWebServer].[DB2].[dbo].[View_HyrjeDalje_Punetoret] as P2 on P1.[Personal_No] collate database_default = P2.[vcNumriPersonal] collate database_default