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:
Implementation of new concepts for a maintenance management system
The existing maintenance management system AW-RS has been ported to a new system,
and expanded with new functionality.