UFN_CONSTITUENTMEMBERSHIP_GETCOUNT

Return

Return Type
int

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN

Definition

Copy


CREATE function dbo.UFN_CONSTITUENTMEMBERSHIP_GETCOUNT
(
    @ID uniqueidentifier
)
returns integer
with execute as caller
as begin
    declare @MEMBERSHIPID uniqueidentifier;

    select @MEMBERSHIPID = MEMBERSHIPID
    from dbo.MEMBER
    where MEMBER.ID = @ID

    return 
    (
        select count(*)
        from dbo.MEMBER
        where MEMBERSHIPID = @MEMBERSHIPID
            and ISDROPPED = 0
    )
end