dbo.procesos_cuit_check

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: <Maria Ines Soria>
-- Create date: <23/11/2017>
-- Description: <Controla si el procesamiento de insur finalizo, esta corriendo, o se quedo colgado>
-- =============================================
CREATE OR ALTER PROCEDURE dbo.procesos_cuit_check  
AS
BEGIN
 SET NOCOUNT ON;
 declare @fin datetime = null
 declare @cant1 int = 0
 declare @cant2 int = 0
    
     set @cant1 = (select count(*) from procesos_cuit_enrichment
           where fecha_proceso = '2017-11-23')
     WAITFOR DELAY '00:00:05' -- espera 5 segundos
     set @cant2 = (select count(*) from procesos_cuit_enrichment
           where Fecha_Proceso = '2017-11-23')
     if (@cant1 = @cant2) 
        begin
       select 'COLGADO' as estado
        end 
     else 
        begin
       select 'CORRIENDO' as estado, @cant2 as cantidad
        end
  

END

GO

Used By

No items found