USP_REPORT_CONSTITUENTBATCHCONTROLREPORT

Returns the data necessary for the Constituent Batch Control report.

Parameters

Parameter Parameter Type Mode Description
@BATCHID uniqueidentifier IN

Definition

Copy


        CREATE procedure dbo.USP_REPORT_CONSTITUENTBATCHCONTROLREPORT(@BATCHID uniqueidentifier)
        with execute as owner
        as
            declare @TABLENAME nvarchar(128);

            set nocount on;

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

            declare @SQLTOEXEC nvarchar(200);

            set @SQLTOEXEC = N'set nocount on;
                select 
                    ID, ISORGANIZATION, CONSTITUENTNAME, ADDRESSBLOCK, CITY, STATE
                from dbo.' + @TABLENAME;
            exec sp_executesql @SQLTOEXEC;