This script is used for auditing the permissions that exist on a SQL Server. It will scan every
database on the server (separate scripts to run only one database are commented at the bottom)
and return four record sets:
1. Audit who is in server-level roles
2. Audit roles on each database, defining what they are and what they can do
3. Audit the roles that users are in
4. Audit any users that have access to specific objects outside of a role
NOTE: This script was written for MS SQL Server 2005 and uses undocumented system tables, rather than the standard MS procedures. It is likely that this script will not work in future versions
of SQL Server.