SQL Server Nation
For all of your SQL Server needs.
Server Role Members

Below is a quick and easy way to query SQL Server 2005 system views to determine which users belong to which server roles on the instance.

SELECT
      rolename = rolep.name,
      membername = memp.name
FROM
      sys.server_role_members rm
      JOIN sys.server_principals rolep ON rm.role_principal_id = rolep.principal_id
      JOIN sys.server_principals memp ON rm.member_principal_id = memp.principal_id

 To determine which users are members of your database level roles on your instance, see this article.


Posted 25 Feb 2009 10:53 AM by TimChapman

Comments

Tip of the Week wrote Database Role Members
on 6 Mar 2009 2:50 PM

Below is a quick and easy way to query SQL Server 2005 system views to determine which users belong to

Copyright SQL Server Nation 2010
Powered by Community Server (Non-Commercial Edition), by Telligent Systems