USP_ORDERTICKETBYPRINTJOB_DELETE
Executes the "Order Ticket Instances By Print Jop 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_ORDERTICKETBYPRINTJOB_DELETE
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier
)
as begin
declare @e int;
declare @contextCache varbinary(128);
set @contextCache = CONTEXT_INFO();
if not @CHANGEAGENTID is null
set CONTEXT_INFO @CHANGEAGENTID
delete from dbo.TICKETPRINTINFO
from dbo.TICKETPRINTINFO
inner join dbo.UFN_TICKETPRINTINFO_GETUNPRINTABLE_BYREPRINTJOB(@ID) [FAILEDTICKETS]
on TICKETPRINTINFO.ID = [FAILEDTICKETS].ID
if not @contextCache is null
set CONTEXT_INFO @contextCache
select @e=@@error;
if @e<>0 return -456; --always return non-zero sp result if an error occurs
return 0;
end