Solved

SQL to list all the users

Posted on 2010-11-18
4
426 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now