USP_SEARCHLIST_SYSTEMROLE
Search for a system role.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@MAXROWS | smallint | IN | Input parameter indicating the maximum number of rows to return. |
@NAME | nvarchar(255) | IN | Name |
Definition
Copy
CREATE procedure dbo.USP_SEARCHLIST_SYSTEMROLE
(
@MAXROWS smallint = 500,
@NAME nvarchar(255) = null
)
as
declare @ISBBCRM bit ;
declare @ISBBIDENABLED bit;
select @ISBBCRM = dbo.UFN_INSTALLEDPRODUCTS_PRODUCTIS('3117d2c8-7f46-42f2-abeb-b654f2f63046');
select @ISBBIDENABLED = dbo.UFN_CONDITIONSETTING_EVALUATEEXISTSCONDITION('WSFederation');
set @NAME = dbo.UFN_SEARCHCRITERIA_GETLIKEPARAMETERVALUE(@NAME, 0, null);
select top(@MAXROWS)
S.ID,
S.NAME,
S.DESCRIPTION
from
dbo.SYSTEMROLE as S
where ((@NAME is null) or (S.NAME like @NAME)) and
(
(@ISBBCRM = 1 and @ISBBIDENABLED = 1) or
((@ISBBCRM = 0 or @ISBBIDENABLED = 0) and S.NAME not in ('ReportAdmins','ReportBrowsers','ReportBuilders','ReportContentManagers','ReportPublishers'))
)
order by S.NAME asc