I am running the following:
sp_msforeachdb @command1= "PRINT '?' EXEC ?.dbo.sp_helprolemember db_owner"
this is providing me the correct results but I am unable to get it to display the database name with the result set?
I would like to have something showing the Database name above then the permissions below each name for each result.
DbRole MemberName MemberSID
db_owner dbo 0x01
My issue is I need to generate a report for Auditing that shows every DB with each user that has DBO rights to that DB. If I can get that in a single report that would be even better.