USP_KPI_CAMPAIGNSUBPRIORITY_GOALVALUE

Parameters

Parameter Parameter Type Mode Description
@VALUE money INOUT
@CAMPAIGNID uniqueidentifier IN
@PRIORITYID uniqueidentifier IN
@SUBPRIORITYID uniqueidentifier IN
@STARTDATE datetime IN
@ENDDATE datetime IN
@CURRENCYID uniqueidentifier IN

Definition

Copy


        CREATE procedure dbo.USP_KPI_CAMPAIGNSUBPRIORITY_GOALVALUE(
            @VALUE money output,
            @CAMPAIGNID uniqueidentifier,
            @PRIORITYID uniqueidentifier,
            @SUBPRIORITYID uniqueidentifier = null,
            @STARTDATE datetime = null,
            @ENDDATE datetime = null,
            @CURRENCYID uniqueidentifier = null
        ) as 
          begin
            set nocount on;
            set @VALUE = 0;

            select
                  @VALUE = CSP.GOAL
              from
                  dbo.CAMPAIGNSUBPRIORITY CSP
              inner join
                  dbo.CAMPAIGNPRIORITY CP ON CSP.CAMPAIGNPRIORITYID = CP.ID
              where
                  CSP.ID = @SUBPRIORITYID
              and
                  CP.ID = @PRIORITYID
              and
                  CP.CAMPAIGNID = @CAMPAIGNID
          end