USP_EMAIL_GETMERGEDATASIZE

Returns the number of rows in the specified merge view.

Parameters

Parameter Parameter Type Mode Description
@MERGEDATAVIEWOBJECT nvarchar(255) IN

Definition

Copy


      CREATE procedure dbo.USP_EMAIL_GETMERGEDATASIZE
      (
        @MERGEDATAVIEWOBJECT nvarchar(255)
      )
      with execute as owner
      as
      begin
        set nocount on;

          declare @TOTALROWS as integer;

        declare    @MERGEDATAQUERY as nvarchar(500);
        declare @PARAMS nvarchar(255);


        set @MERGEDATAQUERY = 'set nocount on; select @ROWS = count(*) from dbo.' + @MERGEDATAVIEWOBJECT
        set @PARAMS = N'@ROWS integer output';

        exec sp_executesql @MERGEDATAQUERY, @PARAMS, @ROWS = @TOTALROWS output;

        select @TOTALROWS as 'TOTALROWS';
      end