How do I get each user and their role in every database on the server?
I figure I'd start with this:
SELECT *
FROM sys.database_role_members drm
INNER JOIN sys.database_principals rp ON drm.role_principal_id = rp.principal_id
INNER JOIN sys.database_principals mp ON drm.member_principal_id = mp.principal_id
I think I figured it out: