USP_SIMPLEDATALIST_CAMPAIGNSITES
List of all sites in the system with which a given user could interact (based on role assignments) and any sites assigned to the campaign to which the user does not otherwise have access.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@CAMPAIGNID | uniqueidentifier | IN | CAMPAIGNID |
Definition
Copy
create procedure dbo.USP_SIMPLEDATALIST_CAMPAIGNSITES
(
@CURRENTAPPUSERID uniqueidentifier,
@CAMPAIGNID uniqueidentifier
)
as
set nocount on;
select
SFU.[SITEID] as VALUE,
SITE.[NAME] as LABEL
from
dbo.SITE
inner join dbo.UFN_SITESFORUSER(@CURRENTAPPUSERID) AS SFU ON SFU.SITEID = SITE.ID
union
select
CAMPAIGNSITE.SITEID as VALUE,
SITE.NAME as LABEL
from
dbo.CAMPAIGNSITE
inner join dbo.SITE on SITE.ID = CAMPAIGNSITE.SITEID
where
CAMPAIGNSITE.CAMPAIGNID = @CAMPAIGNID
order by
LABEL