USP_REPORT_PDACCOUNTSEGMENTMAPPINGBATCHEXCEPTION

Returns the data necessary for the account segment mapping exception report.

Parameters

Parameter Parameter Type Mode Description
@BATCHID uniqueidentifier IN

Definition

Copy


CREATE procedure dbo.USP_REPORT_PDACCOUNTSEGMENTMAPPINGBATCHEXCEPTION
(
    @BATCHID uniqueidentifier
)
as
    set nocount on;

    declare @TABLENAME nvarchar(128);

    select @TABLENAME = dbo.UFN_BATCH_GETREPORTTABLENAME(@BATCHID, 1)

    declare @SQLTOEXEC nvarchar(500);

    set @SQLTOEXEC = N'set nocount on;
        select
            ID, SEGMENTTYPE, SEGMENTNAME, SEGMENTVALUE, REASON
        from dbo.' + @TABLENAME + ' order by SEGMENTTYPE, SEGMENTNAME';

    exec sp_executesql @SQLTOEXEC;