USP_SPONSORSHIP_COMPLETETRANSFER_RECORDOPERATION

Executes the "Sponsorship: Complete Pending Transfer" record operation.

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN Input parameter indicating the ID of the record being updated.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the update.

Definition

Copy


create procedure dbo.USP_SPONSORSHIP_COMPLETETRANSFER_RECORDOPERATION
(
    @ID uniqueidentifier,
    @CHANGEAGENTID uniqueidentifier
)
as begin
    declare @FROMSPONSORSHIPID uniqueidentifier
    declare @TOSPONSORSHIPID uniqueidentifier

    exec dbo.USP_GETPENDINGTRANSFERSPONSORSHIPS
        @ID,
        @FROMSPONSORSHIPID output,
        @TOSPONSORSHIPID output

    if @FROMSPONSORSHIPID is not null and
       @TOSPONSORSHIPID is not null
        exec dbo.USP_SPONSORSHIP_COMPLETETRANSFER
            @TOSPONSORSHIPID,
            @FROMSPONSORSHIPID,
            1,
            @CHANGEAGENTID
    else
    begin
      raiserror('BBERR_NOPENDINGTRANSFER', 13, 1);
      return 1
    end

    return 0;

end