USP_CLONE_SITEPAGE_BBPAYTEMPLATEVERSION

Parameters

Parameter Parameter Type Mode Description
@ORIGINAL_PAGEID int IN
@NEW_PAGEID int IN

Definition

Copy


create procedure dbo.USP_CLONE_SITEPAGE_BBPAYTEMPLATEVERSION
(
  @ORIGINAL_PAGEID int,
  @NEW_PAGEID int
)
as
begin
        declare @BBPAYTEMPLATEVERSION int;
    declare @ENVIRONMENTID uniqueidentifier;

    -- Get the currently active environment

    select @ENVIRONMENTID = ID from dbo.CRMBBENVIRONMENT where ISACTIVE = 1;

    -- Get the template version for this page and the currently active environment

        select @BBPAYTEMPLATEVERSION = BBPAYTEMPLATEVERSION
        from dbo.CMSSITEPAGEBBPAYTEMPLATEVERSION
        where
        SITEPAGEID = @ORIGINAL_PAGEID
    and ENVIRONMENTID = @ENVIRONMENTID;

    -- Add the new page settings

        if(@BBPAYTEMPLATEVERSION is not null)
        begin
            exec dbo.USP_ADDUPDATE_SITEPAGE_BBPAYTEMPLATEVERSION @NEW_PAGEID, @BBPAYTEMPLATEVERSION, @ENVIRONMENTID;
        end
end