UFN_BATCH_IGNOREDUPLICATEROW_EXISTS

This function returns true if the row exists in ignoreduplicate table for a given batch.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@BATCHTYPEID uniqueidentifier IN
@ROWID uniqueidentifier IN

Definition

Copy


        CREATE function dbo.UFN_BATCH_IGNOREDUPLICATEROW_EXISTS (@BATCHTYPEID as uniqueidentifier, @ROWID as uniqueidentifier)
        returns bit
        with execute as caller
        as
        begin
            if exists(select BID.ROWID 
                    from dbo.BATCHIGNOREDUPLICATE BID
                    inner join dbo.BATCH B on BID.BATCHID = B.ID
                    inner join dbo.BATCHTEMPLATE BT on B.BATCHTEMPLATEID = BT.ID
                    where BID.ROWID = @ROWID and BT.BATCHTYPECATALOGID = @BATCHTYPEID
          and BID.CONSTITUENTID is null)

                return 1;

            return 0;
        end