USP_REPORT_PDACCOUNTSEGMENTMAPPINGBATCHCONTROL2

Returns the data necessary for the Account Segment Mapping Batch Control report by system.

Parameters

Parameter Parameter Type Mode Description
@BATCHID uniqueidentifier IN

Definition

Copy


create procedure dbo.USP_REPORT_PDACCOUNTSEGMENTMAPPINGBATCHCONTROL2(@BATCHID uniqueidentifier)
as
begin
    set nocount on;

    declare @TABLENAME nvarchar(128);

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

    declare @SQLTOEXEC nvarchar(200);

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

        exec sp_executesql @SQLTOEXEC;
end