USP_WORKSTATION_PRINTER_DELETE

Executes the "Workstation Printer 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_WORKSTATION_PRINTER_DELETE
(
    @ID uniqueidentifier,
    @CHANGEAGENTID uniqueidentifier
)
as begin
    --get the priority

    declare @SEQUENCE integer;
    declare @WORKSTATIONID uniqueidentifier;

    select
        @SEQUENCE = SEQUENCE,
        @WORKSTATIONID = WORKSTATIONID
    from dbo.WORKSTATIONPRINTER
    where ID = @ID;

    -- use the system generated delete routine to allow proper recording of the deleting agent

    exec USP_WORKSTATIONPRINTER_DELETEBYID_WITHCHANGEAGENTID @ID, @CHANGEAGENTID

    update dbo.WORKSTATIONPRINTER
    set SEQUENCE = SEQUENCE - 1,
        CHANGEDBYID = @CHANGEAGENTID,
        DATECHANGED = getdate()
    where
        SEQUENCE > @SEQUENCE and
        WORKSTATIONID = @WORKSTATIONID

    return 0;

end