title: T-SQL multiple outer join with composite key
body: <p>I have two source views:</p>
  
  <pre><code>View1
  
  -----------------------------------------------------
  |  UserId  |  RoleId  |  Total1 (calculated value)  |
  -----------------------------------------------------
  |    1     |    21    |            9                |
  -----------------------------------------------------
  |    1     |    22    |            5                |
  -----------------------------------------------------
  |    2     |    21    |            7                |
  -----------------------------------------------------
  |    4     |    23    |            4                |
  -----------------------------------------------------
  
  View2
  
  -----------------------------------------------------
  |  UserId  |  RoleId  |  Total2 (calculated value)  |
  -----------------------------------------------------
  |    1     |    21    |            2                |
  -----------------------------------------------------
  |    1     |    24    |            1                |
  -----------------------------------------------------
  |    3     |    21    |            3                |
  -----------------------------------------------------
  |    4     |    21    |            4                |
  -----------------------------------------------------
  </code></pre>
  
  <p>The preferred output is based on UserId AND RoleId equality:</p>
  
  <pre><code>---------------------------------------------
  |  UserId  |  RoleId  |  Total1  |  Total2  |
  ---------------------------------------------
  |    1     |    21    |     9    |    2     |
  ---------------------------------------------
  |    1     |    22    |     5    |   NULL   |
  ---------------------------------------------
  |    1     |    24    |    NULL  |    1     |
  ---------------------------------------------
  |    2     |    21    |     7    |   NULL   |
  ---------------------------------------------
  |    3     |    21    |    NULL  |    3     |
  ---------------------------------------------
  |   ...    |    ...   |    ...   |   ...    |
  </code></pre>
  
  <p>As far I know I should use some type of OUTER JOINs - but how?</p>