UFN_SPONSORSHIP_GETACTIVESPONSORSHIPSFORSPONSOR

Counts the active sponsorships for a sponsor

Return

Return Type
int

Parameters

Parameter Parameter Type Mode Description
@SPONSORID uniqueidentifier IN

Definition

Copy


CREATE function dbo.UFN_SPONSORSHIP_GETACTIVESPONSORSHIPSFORSPONSOR
(
  @SPONSORID uniqueidentifier
)
returns int
with execute as caller
as begin

  declare @COUNT int =0;

  select @COUNT = COUNT(*) from dbo.SPONSORSHIP where SPONSORSHIP.CONSTITUENTID=@SPONSORID and STATUSCODE=1

 return @COUNT
end