Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helprolemember

  No additional text.


Syntax
create procedure sys.sp_helprolemember
	@rolename       sysname = NULL
AS
	if @rolename is not null
	begin
		-- VALIDATE GIVEN NAME
		if not exists (select * from sysusers where name = @rolename and issqlrole = 1)
		begin
			raiserror(15409, -1, -1, @rolename)
			return (1)
		end

		-- RESULT SET FOR SINGLE ROLE
		select DbRole = g.name, MemberName = u.name, MemberSID = u.sid
			from sys.database_principals u, sys.database_principals g, sys.database_role_members m
			where g.name = @rolename
				and g.principal_id = m.role_principal_id
				and u.principal_id = m.member_principal_id
			order by 1, 2
	end
	else
	begin
		-- RESULT SET FOR ALL ROLES
		select DbRole = g.name, MemberName = u.name, MemberSID = u.sid
			from sys.database_principals u, sys.database_principals g, sys.database_role_members m
			where   g.principal_id = m.role_principal_id
				and u.principal_id = m.member_principal_id
			order by 1, 2
	end

	return (0) -- sp_helprolemember

 
Last revision 2008RTM
News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash