• Why keep counts at all?

    Let all logic live in the view, then while any entry in the view, remove

    ALTER PROCEDURE [dbo].[usp_VTrickleDeleteEvent]

    AS

    SET NOCOUNT ON

    SET QUOTED_IDENTIFIER OFF

    BEGIN

    WHILE exists (Select 1 from VEventCleanup)

    BEGIN

    BEGIN TRAN RemoveEvent

    DELETE FROM VEventCleanup –- delete from view with order by

    COMMIT TRAN -- COMMIT to release locks

    END

    END