title: Return all values including NULL
body: <p>I have two tables in SQL Server 2008, and by doing a <code>JOIN</code> I want to get all values, however I get only the values where records exist even though I need the fields with NULL records. </p>
  
  <p>Here is the example on how <code>tableA</code> looks like </p>
  
  <pre><code>|IPAddress  |DNSRecord|
  |192.168.1.1|Test     |
  |192.168.0.1|Test1    |
  </code></pre>
  
  <p><code>tableB</code> stores the following records</p>
  
  <pre><code>|NetworkAddress|SerialNo |
  |192.168.1.1   |1Z5A789DS|
  |192.168.0.1   |NULL     |
  </code></pre>
  
  <p>My query to return the fields I need is the following</p>
  
  <pre><code>SELECT 
      t1.IPAddress,
      t1.DNSRecord,
      t2.SerialNo,
      t2.IPAddress
  FROM tableA t1
  JOIN tableB t2 ON t1.IPAddress = t2.NetworkAddress
  WHERE
     IPAddress LIKE '%' +@IPAddress + '%'
     AND SerialNo LIKE '%' +@SerialNo +'%'
  </code></pre>
  
  <p>The problem with this query is that I get the following result</p>
  
  <pre><code>|IPAddress  |DNSRecord|SerialNo |
  |192.168.1.1|Test     |1Z5A789DS|
  </code></pre>
  
  <p>And I would like to get returned the following result instead</p>
  
  <pre><code>|IPAddress  |DNSRecord|SerialNo |
  |192.168.1.1|Test     |1Z5A789DS|
  |192.168.0.1|Test1    |NULL     |
  </code></pre>