title: Concatenate more than two tables horizontally in SQL Server
body: <p>The Following is the schema</p>
  
  <pre><code>+---------+---------+
  | Employee Table    |
  +---------+---------+
  | EmpId   | Name    | 
  +---------+---------+
  | 1       | John    |
  | 2       | Lisa    |
  | 3       | Mike    |
  |         |         |
  +---------+---------+
  
  +---------+-----------------+
  | Family   Table            |
  +---------+-----------------+
  | EmpId   | Relationship    | 
  +---------+-----------------+
  | 1       | Father          |
  | 1       | Mother          |
  | 1       | Wife            |
  | 2       | Husband         |
  | 2       | Child           |
  +---------+-----------------+
  
  +---------+---------+
  | Loan  Table       |
  +---------+--------+
  | LoanId  | EmpId  | 
  +---------+--------+
  | L1      | 1      |
  | L2      | 1      |
  | L3      | 2      |
  | L4      | 2      |
  | L5      | 3      |
  +---------+--------+
  </code></pre>
  
  <ul>
  <li>Employee Table and Family Table has one to many relationship </li>
  <li>Employee Table and Loan Table has one many Relation ship</li>
  </ul>
  
  <p>I have tried Joins but it gives redundant rows.</p>
  
  <p>Now the desired output will be</p>
  
  <pre><code>+---------+---------+--------------+---------+
  | EmpId   | Name    | RelationShip | Loan    | 
  +---------+---------+--------------+---------+
  | 1       | John    | Father       | L1      |
  | -       | -       | Mother       | L2      |
  | -       | -       | Wife         | -       |
  | 2       | Lisa    | Husband      | L3      |
  | -       | -       | Child        | L4      |
  | 3       | Mike    | -            | L5      |
  |         |         |              |         |
  +---------+---------+--------------+---------+    
  </code></pre>