Solved

SQL to list all the users

Posted on 2010-11-18
4
437 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
[X]
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
4 Comments
 

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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