USP_RATESCALE_DELETE

Executes the "Rate Scale: 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_RATESCALE_DELETE
                (
                    @ID uniqueidentifier,
                    @CHANGEAGENTID uniqueidentifier
                )
                as begin
                    exec USP_RATESCALE_DELETEBYID_WITHCHANGEAGENTID @ID, @CHANGEAGENTID

                    if not exists(select top(1) 1 from dbo.RATESCALE)
                    begin
                        declare @CURRENTDATE datetime
                        set @CURRENTDATE = getdate()

                        update dbo.GROUPSALESDEFAULT set
                            USEFLATRATEPRICING = 0,
                            DATECHANGED = @CURRENTDATE,
                            CHANGEDBYID = @CHANGEAGENTID
                    end

                    return 0;

                end