Solved

SQL to list all the users

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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