title: Match the column values between two tables in SQL Server
body: <p>I have two tables:</p>
  
  <p>ReservationName</p>
  
  <pre><code>   +-------+-------+-------+-------+  
     |            Name               |  
     +-------+-------+-------+-------+   
     | Brad Pitt                     |  
     | Morgan Freeman                |  
     | Bobby deniro                  |  
     +-------+-------+-------+-------+
  </code></pre>
  
  <p>BookingDetails</p>
  
  <pre><code>   +-------+-------+-------+-------+  
     | Name           | ID   | Eid   |  
     +-------+-------+-------+-------+   
     | Brad Pitt      | 1    | ab123 |  
     | Morgan Freeman | 2    | pq123 |  
     | Bobby deniro   | 3    | rs123 |  
     +-------+-------+-------+-------+
  </code></pre>
  
  <p>I have to match the names in ReservationName with BookingDetails .</p>
  
  <p>If they are same (count and value) .</p>
  
  <p>Above example of mine should return true as names are identical and count is 3.
  The aforementioned condition is part of  <strong>If exists</strong> logic that I am using in a stored procedure.</p>