Através do script abaixo, é possível realizar a limpeza da tabela de Integração TBINTEGRATIONNFCE, onde os registros são mantidos por 45 dias.
CREATE PROC [dbo].[LIMPARINTEGRATIONNFCE]
AS
SET NOCOUNT ON
declare @RowCount int
select @RowCount = count(*) from TBINTEGRATIONNFCE with (nolock) where status = 1 and INSERTDATE <= getdate() - 45
WHILE (@RowCount > 0)
BEGIN
delete top(5000) from TBINTEGRATIONNFCE with (rowlock) where status = 1 and INSERTDATE <= getdate() - 45
select @RowCount = @@rowcount
WAITFOR DELAY '00:00:05'
END