USP_DATALIST_SPONSORSHIPOPPORTUNITYREASON

List of all available pending reasons

Parameters

Parameter Parameter Type Mode Description
@CONTEXTID uniqueidentifier IN Input parameter indicating the context ID for the data list.

Definition

Copy


create procedure dbo.USP_DATALIST_SPONSORSHIPOPPORTUNITYREASON(@CONTEXTID uniqueidentifier)
as
    set nocount on;

  /*declare @ELIGIBILITY  tinyint;

  select @ELIGIBILITY = ELIGIBILITYCODE from dbo.SPONSORSHIPOPPORTUNITY
  where ID = @CONTEXTID

 if  @ELIGIBILITY  = 2
    select SPR.ID,         
      SPR.REASON        
      from dbo.SPONSORSHIPOPPORTUNITY SPO
    inner join dbo.SPONSORSHIPREASON SPR on SPR.ID = SPO.SPONSORSHIPREASONID
    where SPO.ID = @CONTEXTID
      order by REASON
  else*/


    select 
        SPR.ID,
      SPR.REASON
      from dbo.SPONSORSHIPOPPORTUNITYREASON SPOR
    inner join dbo.SPONSORSHIPOPPORTUNITY SPO on SPO.ID = SPOR.SPONSORSHIPOPPORTUNITYID
    inner join dbo.SPONSORSHIPREASON SPR on SPR.ID = SPOR.SPONSORSHIPREASONID
    where SPO.ID = @CONTEXTID
      order by REASON