-
List of users on server with Database roles
I want to get all users with the following db roles at once on each server
db_owner
db_accessadmin
db_datareader:
db_datawriter
db_ddladmin:
db_securityadmin
db_backupoperator
is there any easiest way to do this
-
Write your own script and run it on every server.
-
would you give me just a hint on what tables to query to get these info.
--- I am an Oracle DBA new guy in SQL server.
-
Query sysusers, sysprotects, sysmembers and syspermissions. But you can use system sps or modify them to get what you need.
-
This is what Enterprise Manager uses, this only lists db_datareader members, but you can add more insert statements for your need
set nocount on
create table #SQLDMOTemp (
role_col nvarchar(132) NOT NULL,
mem_col nvarchar(132) NOT NULL,
id_col nvarchar(176))
insert into #SQLDMOTemp
(role_col, mem_col, id_col)
exec sp_helprolemember N'db_datareader'
select mem_col from #SQLDMOTemp
drop table #SQLDMOTemp
set nocount off
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|