title: Left join on 2 varchar fields not working
body: <p>Im having trouble joining two varchar(31) fields on sql server 2008. below is my query and it works fine </p>
  
  <pre><code>select A.CustId,A.Country,B.Country from [ACC].[dbo].[Customer] as A
  left join 
  [Task Centre].[dbo].[CountryCodes] as B on A.Country=B.Country]
  </code></pre>
  
  <p>the results are as follows</p>
  
  <pre><code>CustomerA    United Kingdom    Null
  CustomerB    Ireland           Ireland
  CustomerC    Spain             Spain
  CustomerD    South Africa      Null
  </code></pre>
  
  <p>South Africa and United Kingdom don't match even though they are in both dbs </p>
  
  <p>I have tried to replace the space but its very slow and doesnt work. I think its something to do with the whitespace but I cant find the right command to achieve what I want.</p>
  
  <p>Bear with me if I have omitted anything as Im a novice, I have also searched everywhere for an answer but cant find one that works for me.</p>
  
  <p>Any help is greatly appreciated</p>
  
  <p>Mike</p>