USP_MKTSOURCECODEPARTDEFINITION_DELETE
Removes a source code part definition from the system.
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_MKTSOURCECODEPARTDEFINITION_DELETE]
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier
)
as
set nocount on;
declare @ITEMTYPECODE tinyint;
select
@ITEMTYPECODE = [ITEMTYPECODE]
from dbo.[MKTSOURCECODEPARTDEFINITION]
where [ID] = @ID;
if @ITEMTYPECODE <> 5
begin
raiserror('BBERR_MKTSOURCECODEPARTDEFINITION_ONLYDELETEUSERDEFINED', 1, 11);
raiserror('Only user defined source code part definitions can be deleted.', 13, 1);
return 1;
end
--Delete the source code part...
exec dbo.[USP_MKTSOURCECODEPARTDEFINITION_DELETEBYID_WITHCHANGEAGENTID] @ID, @CHANGEAGENTID;
return 0;