title: How to list role members in SQL Server 2008 R2
body: <p>I'm using the following T-SQL to obtain role members from my SQL Server 2008 R2 database:</p>
  
  <pre><code>select rp.name as database_role, mp.name as database_user
  from sys.database_role_members drm
    join sys.database_principals rp on (drm.role_principal_id = rp.principal_id)
    join sys.database_principals mp on (drm.member_principal_id = mp.principal_id)
  order by rp.name
  </code></pre>
  
  <p>When I examine the output I notice that the only role members listed for <code>db_datareader</code> are db roles - no user members of <code>db_datareader</code> are listed in the query.</p>
  
  <p>Why is that? How can I also list the user members of my db roles?</p>
  
  <p>I guess I should also ask whether the table <code>sys.database_role_members</code> actually contains all members of a role?</p>