Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helpsrvrole

  No additional text.


Syntax
create procedure sys.sp_helpsrvrole
	@srvrolename		sysname = NULL
AS
	if @srvrolename is not null
	begin
		-- VALIDATE GIVEN NAME
		if not exists (select * from master.dbo.spt_values
				where name = @srvrolename and low = 0 and type = 'SRV')
		begin
			raiserror(15412, -1, -1, @srvrolename)
			return (1)
		end

		-- RESULT SET FOR SINGLE SERVER-ROLE
		-- UNDONE: REMOVE THE "Description" OUTPUT (should be BOL only)
		select 'ServerRole' = v1.name, 'Description' = v2.name
			from master.dbo.spt_values v1, master.dbo.spt_values v2
			where v1.name = @srvrolename and
				  v1.low = 0 and
				  v1.type = 'SRV' and
				  v2.low = -1 and
				  v2.type = 'SRV' and
				  v1.number = v2.number
	end
	else
	begin
		-- RESULT SET FOR ALL SERVER-ROLES
		-- UNDONE: REMOVE THE "Description" OUTPUT (should be BOL only)
		select 'ServerRole' = v1.name, 'Description' = v2.name
			from master.dbo.spt_values v1, master.dbo.spt_values v2
			where v1.low = 0 and
				  v1.type = 'SRV' and
				  v2.low = -1 and
				  v2.type = 'SRV' and
				  v1.number = v2.number
	end

    return (0) -- sp_helpsrvrole

 
Last revision 2008RTM
See also

  sp_helpsrvrolemember (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