USP_DATALIST_AMPROIMPORT_AUCTIONSECURITY

Returns security information for auctions in AuctionMaestro Pro import batches.

Parameters

Parameter Parameter Type Mode Description
@BATCHID uniqueidentifier IN
@APPUSERID uniqueidentifier IN

Definition

Copy


                CREATE procedure dbo.USP_DATALIST_AMPROIMPORT_AUCTIONSECURITY
                (
                    @BATCHID uniqueidentifier,
                    @APPUSERID uniqueidentifier
                )
                as
                set nocount on;
                declare @REALBATCHID uniqueidentifier = @BATCHID
                declare @ISEXCEPTIONBATCH bit = 0;
                declare @AUCTIONID uniqueidentifier = null;

                select 
                    @ISEXCEPTIONBATCH = 1
                from dbo.BATCH where BATCH.ID = @BATCHID and ORIGINATINGBATCHID is not null;

                while @ISEXCEPTIONBATCH = 1
                begin
                    set @ISEXCEPTIONBATCH = 0;

                    set @REALBATCHID = @BATCHID;

                    select 
                        @ISEXCEPTIONBATCH = 1,
                        @BATCHID = BATCH.ORIGINATINGBATCHID
                    from dbo.BATCH where BATCH.ID = @BATCHID and ORIGINATINGBATCHID is not null;
                end

                select top 1 
                    @AUCTIONID = BATCHAMPRODATA.EVENTAUCTIONID
                from dbo.BATCHAMPRODATA
                where BATCHAMPRODATA.ID = @REALBATCHID;

                select
                    case 
                        when dbo.UFN_EVENT_USERHASSITEACCESS(@APPUSERID, @AUCTIONID) = 1 then cast(1 as bit)
                        else cast(0 as bit)
                    end as [AUCTIONGRANTED]