USP_KPI_CAMPAIGNHIERARCHYGOAL_GOALVALUE

Parameters

Parameter Parameter Type Mode Description
@VALUE money INOUT
@CAMPAIGNID uniqueidentifier IN
@CAMPAIGNHIERARCHYGOALID uniqueidentifier IN
@CURRENCYID uniqueidentifier IN

Definition

Copy


                    CREATE procedure dbo.USP_KPI_CAMPAIGNHIERARCHYGOAL_GOALVALUE (
                        @VALUE money output,
                        @CAMPAIGNID uniqueidentifier,
                        @CAMPAIGNHIERARCHYGOALID uniqueidentifier,
                        @CURRENCYID uniqueidentifier = null
                    ) as begin

                        set @VALUE = 0;

                        --Because we are forcing the currency to be the campaign's base, we can just get the 

                        --    AMOUNT off the goal table without having to worry about any conversions.


                        select
                            @VALUE = CAMPAIGNHIERARCHYGOAL.AMOUNT
                        from
                            dbo.CAMPAIGNHIERARCHYGOAL
                        where
                            CAMPAIGNHIERARCHYGOAL.ID = @CAMPAIGNHIERARCHYGOALID
                        and
                            CAMPAIGNHIERARCHYGOAL.CAMPAIGNID = @CAMPAIGNID

                    end