UFN_SPONSORSHIP_HASACTIVERECURRINGADDITIONALGIFT

Returns true if the sponsorship has a recurring additional gift.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN

Definition

Copy


CREATE function dbo.UFN_SPONSORSHIP_HASACTIVERECURRINGADDITIONALGIFT(@ID uniqueidentifier)
returns bit
with execute as caller
as begin
    if (select count(*) from dbo.SPONSORSHIPRECURRINGADDITIONALGIFT where SPONSORSHIPRECURRINGADDITIONALGIFT.SPONSORSHIPID = @ID AND SPONSORSHIPRECURRINGADDITIONALGIFT.STATUSCODE in (0,1,5)) > 1
        return 1;
    return 0;
end