USP_DATAFORMTEMPLATE_VIEW_EVENTCONSTITUENTSITE

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN
@CURRENTAPPUSERID uniqueidentifier IN
@DATALOADED bit INOUT
@DEFAULTCONSTITUENTSITE nvarchar(200) INOUT

Definition

Copy

create procedure dbo.USP_DATAFORMTEMPLATE_VIEW_EVENTCONSTITUENTSITE
(
  @ID uniqueidentifier,
  @CURRENTAPPUSERID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @DEFAULTCONSTITUENTSITE nvarchar(200) = null output
)
as
        -- be sure to set this, in case the select returns no rows
    set @DATALOADED = 0;

    -- populate the output parameters, which correspond to fields on the form.  Note that
    -- we set @DATALOADED = 1 to indicate that the load was successful.  Otherwise, the system
    -- will display a "no data loaded" message.
    select
        @DATALOADED = 1,
        @DEFAULTCONSTITUENTSITE = isnull(S.NAME, 'None')
    from dbo.EVENT E (nolock)
  join dbo.EVENTEXTENSION EX (nolock) on E.ID = EX.EVENTID
  left join dbo.SITE S (nolock) on S.ID = EX.SITEID
    where E.ID = @ID

    return 0;