Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --primero debes de validar las fechas q se han realizando las operaciones de envio de analytics
- SELECT * FROM indicator_date_relation ORDER BY date_relation DESC
- --para validar si se realizaron los proceso de envio... es id_relation con el Id de la tabla indicator_date_relation
- SELECT * FROM indicator_data_operation WHERE id_relation='5b966fb1f821aa6ab284cb69b13a4e49'
- --ya validando q si no se han creado los registros de envio
- --se utiliza este comando que solo se cambia la fecha
- --SCRIPT PARA GENERAR LOS DATOS FALTANTES QUE NO SE HALLAN ENVIADO
- DECLARE @id_relation VARCHAR(32)
- DECLARE @sqlCommand NVARCHAR(MAX)
- DECLARE @date_ticket DATE ='2021-04-11'
- SET @id_relation=(SELECT [dbo].[indicator_returnIdGeneratedDate](@date_ticket))
- IF NOT EXISTS(SELECT TOP(1)IdRelation FROM indicator_date_relation WITH (NOLOCK) WHERE IdRelation=@id_relation)
- BEGIN
- PRINT 'GUARDANDO ID RELATION'
- SET @sqlCommand=' INSERT INTO indicator_date_relation(IdRelation,date_relation) VALUES('+CHAR(39)+@id_relation+CHAR(39)+','+CHAR(39)+CONVERT(VARCHAR(MAX),@date_ticket)+CHAR(39)+')'
- PRINT @sqlCommand
- EXEC (@sqlCommand)
- EXEC [dbo].[indicator_create_send_data] @date_ticket,'0','A'
- EXEC [dbo].[indicator_execute_send_data] @date_ticket
- END
- ELSE
- BEGIN
- PRINT 'ID RELATION, SI EXISTE, SOLO EJECUTO LOS COMANDO PARA GENERAR EL DIA'
- EXEC [dbo].[indicator_create_send_data] @date_ticket,'0','A'
- EXEC [dbo].[indicator_execute_send_data] @date_ticket
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement