USP_ORGANIZATIONPOSITION_DELETE

Executes the "Organization Position: Delete" record operation.

Parameters

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

Definition

Copy


                    create procedure dbo.USP_ORGANIZATIONPOSITION_DELETE(@ID uniqueidentifier, @CHANGEAGENTID uniqueidentifier)
                    as begin
                        set nocount on;

                        --Move children

                        update dbo.ORGANIZATIONHIERARCHY
                        set PARENTID = (select PARENTID from dbo.ORGANIZATIONHIERARCHY where ID = @ID)
                        where PARENTID = @ID;

                        exec USP_ORGANIZATIONHIERARCHY_DELETEBYID_WITHCHANGEAGENTID @ID, @CHANGEAGENTID
                        return 0;
                    end