USP_SEARCH_TEAMFUNDRAISINGTEAMFROMEVENT

This provides the ability to search for team fundraising teams based on an associated event.

Parameters

Parameter Parameter Type Mode Description
@EVENTID uniqueidentifier IN Event
@TEAMNAME nvarchar(100) IN Team name
@MAXROWS smallint IN Input parameter indicating the maximum number of rows to return.

Definition

Copy


            create procedure dbo.USP_SEARCH_TEAMFUNDRAISINGTEAMFROMEVENT
                (
                    @EVENTID uniqueidentifier = null,
                    @TEAMNAME nvarchar(100) = null,
                    @MAXROWS smallint = 500
                )
                as

                set nocount on;

                select 
                    tft.ID as ID,
                    tft.NAME as NAME,
                    e.NAME as EVENT
                from TEAMFUNDRAISINGTEAM tft
                    inner join EVENT e on e.APPEALID=tft. APPEALID
                where
                    (e.ID=@EVENTID or @EVENTID is null
                        and tft.NAME like coalesce(@TEAMNAME,'')+'%'
                order by tft.NAME