title: Convert varchar to bigInt including null values
body: <p>I am trying to get all the values which exist in one table and not the other. The condition to join them is varchar in one table and bigInt in the other (swmItems is bigInt, OBJ_TAB is varchar). I tried the following: </p>
  
  <pre><code> SELECT si.upc as upc from swmItems si 
   left outer join dbo.OBJ_TAB obj  on cast(obj.F01 as BIGINT) = si.upc 
   WHERE obj.F01 IS NULL
  </code></pre>
  
  <p>however it gives me the error: "Error converting data type varchar to bigint".</p>
  
  <p>I also tried the following:</p>
  
  <pre><code> SELECT * FROM OBJ_TAB WHERE ISNUMERIC(f01) != 1
  </code></pre>
  
  <p>And it return nothing so all my values should be numbers in OBJ_TAB</p>
  
  <p>I think it's because of the values exist in the first table and not the second (trying to convert null to bigInt). Is there anyway to join the two tables this way?</p>
  
  <p>I am using Microsoft SQL 2012</p>
  
  <p>Footnote: In OBJ_TAB there exist number of zeros in front of the numbers that's why comparing everything as varchar doesn't work for me.</p>