MSSQL2000: get list of role members
-
03-07-2019 - |
Question
I know a role name and want to find all users in this role. How do I acheive this in SQL Server 2000 (in the SQL script, not in Management Studio or other tool)?
Solution
You can use the following stored procedures:
For fixed server roles, the stored procedure is sp_helpsrvrolemember:
exec sp_helpsrvrolemember 'role'
For general roles, the stored procedure is sp_helprolemember:
exec sp_helprolemember 'role'
OTHER TIPS
Just use SQL-DMO: Replace rolename with your role
exec sp_helprolemember rolename
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow