UFN_SPONSOR_GETBENEFITLIST_BYSPONSORID

Return the FAF event sponsor's list of benefit name.

Return

Return Type
nvarchar(4000)

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN

Definition

Copy


create function dbo.UFN_SPONSOR_GETBENEFITLIST_BYSPONSORID(@ID uniqueidentifier)
returns nvarchar(4000)
with execute as caller
as begin
    -- do work here and return a value


    declare @BENEFITSTRING nvarchar(max) = ''

    select @BENEFITSTRING  = @BENEFITSTRING + 
        case when @BENEFITSTRING = '' then B.NAME else '; ' + B.NAME end
    from dbo.SPONSORBENEFITEXTENSION S(nolock)
    inner join dbo.BENEFIT B(nolock)
        on B.ID = S.BENEFITID
    where S.SPONSORID = @ID;

    return @BENEFITSTRING;
end