SQL to list all the users

I need to get a list of all the uses and the permissions each has.
Is there a simple script that will provide this data?
LVL 1
n2dwebprogrammerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Alpesh PatelConnect With a Mentor Assistant ConsultantCommented:
select * from sys.syslogins
select * from sys.syspermissions
0
 
rajeshrolenCommented:
below link will provide you complete query for getting all user and there permission details on sql server:

http://consultingblogs.emc.com/jamiethomson/archive/2007/02/09/SQL-Server-2005_3A00_-View-all-permissions--_2800_2_2900_.aspx

http://thedailyreviewer.com/dbsoftware/view/list-of-sql-server-users-105146414

http://www.sqlservercentral.com/articles/Administration/listofdatabaseuserswithdatabaseroles/1545/

--       List all user permissions of all Database objects
      sp_helprotect                               

--       List all user permissions of tblSalary
      sp_helprotect 'dbo.tblSalary'       

--       List all user permissions of sp_Get_Salary
      sp_helprotect 'dbo.sp_Get_Salary'

--       List all user permissions of sp_Get_Salary
      sp_helprotect 'dbo.sp_Get_Salary', 'emp_user'

--       List all user permissions of sp_Get_Salary provided by dbo
      sp_helprotect 'dbo.sp_Get_Salary', null,'dbo'

--       List all Object type user permissions
      sp_helprotect null, null,null,'o'

--       List all statement type user permissions
      sp_helprotect null, null,null,'s'
0
 
andigwandiCommented:
try sp_helplogins
0
All Courses

From novice to tech pro — start learning today.