views:

2292

answers:

1

Hi folks

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 serverB 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?

Thanks

Update: I found an alternative solution. In the Linked Server Properties, you can specify the linked server's collation there.

+6  A: 

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.

Biri