USP_GENERALPURPOSEEMAIL_VALIDQUEUEJOBCOUNT

Retrieves processable job count, as well as performing cleanup on stuck jobs.

Definition

Copy


      create procedure dbo.USP_GENERALPURPOSEEMAIL_VALIDQUEUEJOBCOUNT
      with execute as owner
      as
      begin
          set nocount on;

        declare @TOTALJOBS integer;

        set @TOTALJOBS = (select count(*) from dbo.EMAILQUEUEGENERALPURPOSE where PROCESSAFTERDATE <= getutcdate());

       return @TOTALJOBS;

      end