USP_REPORT_PEOPLEFINDERBATCHCONTROL

Returns the data necessary for the PeopleFinder batch control report.

Parameters

Parameter Parameter Type Mode Description
@BATCHID uniqueidentifier IN

Definition

Copy


CREATE procedure dbo.USP_REPORT_PEOPLEFINDERBATCHCONTROL
(
    @BATCHID uniqueidentifier
)
with execute as caller
as
    set nocount on;

    declare @TABLENAME nvarchar(128);
    select @TABLENAME = dbo.UFN_BATCH_GETREPORTTABLENAME(@BATCHID, 0)

    declare @SQLTOEXEC nvarchar(300);
    set @SQLTOEXEC = N'set nocount on;
        select ID,
            NAME,
      ADDRESSBLOCK,
      CITY,
      POSTCODE,
      ABBREVIATION,
      DECEASED
        from dbo.' + @TABLENAME;

    exec sp_executesql @SQLTOEXEC;