Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_dbfixedrolepermission

  No additional text.


Syntax
create procedure sys.sp_dbfixedrolepermission
	@rolename       sysname = NULL
AS
	if @rolename is not null
	begin
		-- VALIDATE GIVEN NAME
		if not exists (select * from sys.database_principals where name = @rolename
						and principal_id >= 16384 and principal_id <= 16393)
		begin
			raiserror(15412, -1, -1, @rolename)
			return (1)
		end

		-- RESULT SET FOR SINGLE FIXED-ROLE
		select distinct 'DbFixedRole' = u.name, 'Permission' = p.name collate database_default
			from sys.database_principals u, sys.role_permissions p
			where u.name = @rolename and u.principal_id >= 16384 and u.principal_id <= 16393 and
				  p.type = 'DBR' and p.low > 0 and
				  ((u.principal_id = 16384 and p.number >= 16384 and p.number < 16392) or
				  (u.principal_id <> 16384 and u.principal_id = p.number))
			order by u.name, p.name collate database_default
	end
	else
	begin
		-- RESULT SET FOR ALL FIXED-ROLES
		select distinct 'DbFixedRole' = usr.name, 'Permission' = spv.name collate database_default
			from sys.database_principals usr, sys.role_permissions spv
			where usr.principal_id >= 16384 and usr.principal_id <= 16393 and
				  spv.type = 'DBR' and spv.low > 0 and
				  ((usr.principal_id = 16384 and spv.number >= 16384 and spv.number < 16392) or
				  (usr.principal_id <> 16384 and usr.principal_id = spv.number))
			order by usr.name, spv.name collate database_default
	end

    return (0) -- sp_dbfixedrolepermission

 
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