UFN_SPONSORSHIPTRANSACTION_GIFTFINANCIALSPONSORIDNOTSPONSOR

Returns true if the sponsorship's constituent is different than the specified gift financial sponsor.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@SPONSORSHIPID uniqueidentifier IN
@GIFTFINANCIALSPONSORID uniqueidentifier IN

Definition

Copy


create function dbo.UFN_SPONSORSHIPTRANSACTION_GIFTFINANCIALSPONSORIDNOTSPONSOR(
    @SPONSORSHIPID uniqueidentifier,
    @GIFTFINANCIALSPONSORID uniqueidentifier
)
returns bit
with execute as caller
as begin
    if @GIFTFINANCIALSPONSORID is null return 1;

    declare @CORRESPONDINGSPONSORID uniqueidentifier;

    select @CORRESPONDINGSPONSORID = CONSTITUENTID
    from dbo.SPONSORSHIP
    where ID = @SPONSORSHIPID;

    if @GIFTFINANCIALSPONSORID = @CORRESPONDINGSPONSORID
        return 0;

    return 1;
end