I've got 2 remote databases as part of a query
select p.ID,p.ProjectCode_VC,p.Name_VC,v.*
FROM [serverB].Projects.dbo.Projects_T p
LEFT JOIN [serverA].SOCON.dbo.vw_PROJECT v on
p.ProjectCode_VC = v.PROJ_CODE
The problem is that serverA uses collation Latin1_General_BIN and serverB uses Latin1_General_CP1_CP_AS and the query refuses to run.
Both servers are SQL 2000 servers. Both databases are set in stone so I cannot change their collations, unfortunately.
Is there anyway you guys know how to get this to work?
Update: I found an alternative solution. In the Linked Server Properties, you can specify the linked server's collation there.
Just add the collation to your select, like:
select
p.ID,
p.ProjectCode_VC,
p.Name_VC,
v.*
FROM
[serverB].Projects.dbo.Projects_T p
LEFT JOIN [serverA].SOCON.dbo.vw_PROJECT v on p.ProjectCode_VC
collate Latin1_General_Bin = v.PROJ_CODE
or the other way around. So "convert" one of the collations to the other.
Or you can use a more generic query like this:
select * from profile, userinfo
where profile.custid collate database_default = userinfo.custid collate database_default
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With