The following code is a great idea (refer to Figure A below). Would it be possible to bundle this into one command that does all of these steps but also creates the temp table, dumps the output into a tab delimited text file (i.e., c:\dbexport.txt), then deletes the procedure and temp table (if these are even necessary ... actually i'd prefer this command to not use an sp and table if possible)?
(1) Create the following code as sp_GetPerms in the master database:
db_name() as [DBName],
when 0 then 'DATABASE'
end as [Object]
from sys.database_permissions perms
join sys.database_principals prin on perms.grantee_principal_id=prin.principal_id
where prin.type in ('U','S')
(2) Then you could create a temp table that has the same structure as the above query and do....
insert into #temptable
exec sp_msforeachdb "use ?
select * from #temptable
This would return a single recordset with all of the user perms.