Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helpgroup

  No additional text.


Syntax
create procedure sys.sp_helpgroup --- 1996/04/08 00:00
@grpname sysname = NULL		/* group name of interest */
as

/*
**  If no group name given, list all the groups.
*/
if @grpname is null
begin
	select Group_name = name, Group_id = principal_id
		from sys.database_principals
		where type = 'R'
		order by name

	return (0)
end

/*
**  Check to see if group exists.
*/
if not exists (select * from sys.database_principals where name = @grpname and type = 'R')
	begin
		raiserror(15014,-1,-1,@grpname)
		return (1)
	end

/*
**  List the particulars for the group.
*/
select Group_name = substring(g.name, 1, 25), Group_id = g.principal_id,
	   Users_in_group = substring(u.name, 1, 25), Userid = u.principal_id
	from sys.database_principals u, sys.database_principals g, sys.database_role_members m
	where g.name = @grpname
		and g.principal_id = m.role_principal_id
		and u.principal_id = m.member_principal_id
	order by 1, 2

return (0) -- sp_helpgroup

 
Last revision
See also

  sp_helpuser (Procedure)
       



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