To exclude non-user DBs: or
Listing DBs and their users with rights on SQL Server
Original post here: https://www.sqlservercentral.com/Forums/1560182/Script-to-get-the-list-of-users-and-permissions-in-a-database#bm1560813 With multiple result sets: Single result set using COALESCE-Operator: