magritton
7/6/2015 - 1:00 PM

SQL Query to find the server roles and the members of those roles.

SQL Query to find the server roles and the members of those roles.

use master
go
select sp_role.name,sp_mems.name, * from sys.server_role_members srm
left outer join sys.server_principals sp_role
on sp_role.principal_id = srm.role_principal_id
left outer join sys.server_principals sp_mems
on sp_mems.principal_id = srm.member_principal_id

select * from sys.server_role_members srm
select * from sys.server_principals