USP_USERSETTINGSLISTBUILDER_DELETE

Parameters

Parameter Parameter Type Mode Description
@CURRENTAPPUSERID uniqueidentifier IN
@CHANGEAGENTID uniqueidentifier IN
@USERSETTINGSPATH nvarchar(4000) IN

Definition

Copy


                create procedure dbo.USP_USERSETTINGSLISTBUILDER_DELETE
                (
                    @CURRENTAPPUSERID uniqueidentifier,
                    @CHANGEAGENTID uniqueidentifier,
                    @USERSETTINGSPATH nvarchar(4000)
                )
                as begin

                    declare @ID uniqueidentifier;

                    select
                        @ID = ID
                    from dbo.USERSETTINGSLISTBUILDER
                    where APPUSERID = @CURRENTAPPUSERID
                    and PATH = @USERSETTINGSPATH;

                    if @ID is not null
                    begin
                        -- Audit trail not enabled, so just issue a delete instead of the _DELETEDBY_ audit proc

                        delete from dbo.USERSETTINGSLISTBUILDER where ID = @ID;
                        return 0;
                    end
                    -- Better safe than sorry, don't attempt the call if the settings aren't found

                    else
                        return 1;

                end