How to determine effective permissions and how granted for a local or domain account With SQL Server - if you have a local or domain user (including accounts like LOCAL SYSTEM) how can you determine


What effective permissions they have on a database 
How those permissions are granted (e.g. which roles, any direct etc)
In the Server you can look for 

exec sp_helpsrvrolemember sysadmin exec sp_helpsrvrolemember dbcreator


In the databases that you want

exec sp_helprolemember db_datareader
exec sp_helprolemember db_datawriter
exec sp_helprolemember db_ddladmin
exec sp_helprolemember db_owner


and all direct permissions

exec sp_helprotect null,null