USP_DATAFORMTEMPLATE_VIEW_NATIONALFUNDRAISINGGROUP

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN
@DATALOADED bit INOUT
@NAME nvarchar(200) INOUT
@CAMPAIGNID uniqueidentifier INOUT
@CAMPAIGNNAME nvarchar(400) INOUT
@CONSTITUENTID uniqueidentifier INOUT

Definition

Copy

CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_NATIONALFUNDRAISINGGROUP
(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @NAME nvarchar(200) = null output,
    @CAMPAIGNID uniqueidentifier = null output,
    @CAMPAIGNNAME nvarchar(400) = null output,
    @CONSTITUENTID uniqueidentifier = null output
)
as
    set nocount on;

    -- 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,
           @NAME = a.NAME,
       @CAMPAIGNID = a.CAMPAIGNID,
       @CAMPAIGNNAME = CONVERT( varchar, b.NAME)  + ' > ' + CONVERT( varchar, a.Name ),
       @CONSTITUENTID = a.GROUPCONSTITUENTID
    from dbo.FAFNFGCampaign a (NOLOCK)
    join dbo.FAFPROGRAM b 
        on a.CAMPAIGNID = b.ID
    where a.ID = @ID

    return 0;