Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL to list all the users

Posted on 2010-11-18
4
433 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:n2dweb
4 Comments
 
LVL 13

Expert Comment

by:NarendraG
ID: 34170564
0
 

Expert Comment

by:rajeshrolen
ID: 34170815
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
 
LVL 1

Expert Comment

by:andigwandi
ID: 34171666
try sp_helplogins
0
 
LVL 21

Accepted Solution

by:
Alpesh Patel earned 500 total points
ID: 34171999
select * from sys.syslogins
select * from sys.syspermissions
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question