UFN_CONSTITUENT_HASGROUPMEMBERRECORD

Returns whether or not a constituent has ever been a member of any constituent group.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@CONSTITUENTID uniqueidentifier IN

Definition

Copy


            CREATE function dbo.UFN_CONSTITUENT_HASGROUPMEMBERRECORD
      (
          @CONSTITUENTID uniqueidentifier
      ) returns bit
      with execute as caller
      as
      begin
          declare @ISGROUPMEMBER bit;

        select 
            @ISGROUPMEMBER = case when count(GM.ID) > 0 then cast(1 as bit) else cast(0 as bit) end
        from 
            dbo.GROUPMEMBER GM
        where 
            GM.MEMBERID = @CONSTITUENTID;

          return @ISGROUPMEMBER;
      end