USP_DATALIST_OPPORTUNITY_CAMPAIGN

A datalist of campaigns for a given opportunity.

Parameters

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

Definition

Copy


                CREATE procedure dbo.USP_DATALIST_OPPORTUNITY_CAMPAIGN
                (
                    @OPPORTUNITYID uniqueidentifier
                )
                as begin

                    select 
                        OPPORTUNITYCAMPAIGN.ID,
                        CAMPAIGN.NAME as NAME,
                        dbo.UFN_CAMPAIGNTYPECODE_GETDESCRIPTION(CAMPAIGNTYPECODEID) as TYPE,
                        CAMPAIGN.STARTDATE,
                        CAMPAIGN.ENDDATE,
                        CAMPAIGN.ID as CAMPAIGNID
                    from
                        dbo.OPPORTUNITYCAMPAIGN
                        inner join dbo.CAMPAIGN on CAMPAIGN.ID = OPPORTUNITYCAMPAIGN.CAMPAIGNID
                    where
                        OPPORTUNITYCAMPAIGN.OPPORTUNITYID=@OPPORTUNITYID

                end