USP_DATAFORMTEMPLATE_ADD_SPONSORSHIPLOCATION_PRELOAD

The load procedure used by the edit dataform template "Sponsorship Location Add Form"

Parameters

Parameter Parameter Type Mode Description
@PARENTLOCATIONID uniqueidentifier IN Input parameter indicating the context ID for the record being added.
@PARENTLOCATIONSTRING nvarchar(max) INOUT Within
@SPONSORSHIPLOCATIONTYPECODEID uniqueidentifier INOUT Type

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_SPONSORSHIPLOCATION_PRELOAD
(
    @PARENTLOCATIONID uniqueidentifier,
    @PARENTLOCATIONSTRING nvarchar(max) = null output,
    @SPONSORSHIPLOCATIONTYPECODEID uniqueidentifier = null output
)
as
    set nocount on;

    select
        @PARENTLOCATIONSTRING = dbo.UFN_SPONSORSHIPLOCATION_FULLSTRING(SPONSORSHIPLOCATION.ID, CHAR(13) + CHAR(10), 1, 4),
        @SPONSORSHIPLOCATIONTYPECODEID = (select top 1 NEXTTYPE.ID
                                          from dbo.SPONSORSHIPLOCATIONTYPECODE NEXTTYPE
                                          where NEXTTYPE.SEQUENCE > THISTYPE.SEQUENCE
                                          and NEXTTYPE.ACTIVE = 1
                                          order by NEXTTYPE.SEQUENCE)
    from
        dbo.SPONSORSHIPLOCATION
    inner join
        dbo.SPONSORSHIPLOCATIONTYPECODE as THISTYPE on THISTYPE.ID = SPONSORSHIPLOCATION.SPONSORSHIPLOCATIONTYPECODEID
    where
        SPONSORSHIPLOCATION.ID = @PARENTLOCATIONID

    return 0;