dbo.IV_ready2start

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

6
Name Data Type Length Description
@p_accion varchar 50
@p_contraparte int 4
@p_informe int 4
@p_user_id int 4
@p_servicio_contratado smallint 2
@p_cliente int 4

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/* SP LN_BLUE_UPD */

CREATE OR ALTER PROCEDURE dbo.IV_ready2start
 @p_accion         varchar(50), /*READY2START*/
 @p_contraparte        int,
 @p_informe         int,
 @p_user_id         int,
 @p_servicio_contratado      smallint,    
 @p_cliente         int
 
 
AS
BEGIN
 SET NOCOUNT ON;

 /* AGB DECLARAMOS VARIABLES PARA EVITAR PARAMETER SNIFFING EN LA CONFECCIÓN DEL QUERY PLAN */
 DECLARE @V_accion           varchar(50)  = @p_accion
 DECLARE @V_contraparte          int    = @p_contraparte
 DECLARE @V_informe           int    = @p_informe
 DECLARE @V_user_id           int    = @p_user_id
 DECLARE @V_servicio_contratado        smallint   = @p_servicio_contratado
 DECLARE @V_cliente           int    = @p_cliente

 
 
 if (upper(@V_accion) = 'READY2START') 
 begin
   update informes set ready_to_start=1,ready_to_start_date=getdate(),ready_to_start_trigger_task=@V_informe,ready_to_start_user_id=@V_user_id 
   where estado_informe='A' and informe = @V_informe

   -- TRAZABILIDAD DEL READY 2 START 
   exec insertar_trazabilidad 'TAREAS DEPENDIENTES LISTAS PARA INICIAR',@V_cliente,'READYTOSTART','BACK',@V_contraparte,@V_user_id,NULL,@V_servicio_contratado

 end

 if (upper(@V_accion) = 'UNDO_READY2START') 
 begin
   update informes set ready_to_start=0,ready_to_start_date=null
   where estado_informe='A' and informe = @V_informe

   -- TRAZABILIDAD DEL READY 2 START 
   exec insertar_trazabilidad 'TAREAS DEPENDIENTES DESHACER LISTAS PARA INICIAR',@V_cliente,'UNDO_READY2START','BACK',@V_contraparte,@V_user_id,NULL,@V_servicio_contratado

 end


 
 IF ( upper(@V_accion) = 'READY2START_DCL' )
    BEGIN
        update informes set ready_to_start=1,ready_to_start_date=getdate(),ready_to_start_trigger_task=@V_informe,ready_to_start_user_id=@V_user_id 
        where estado_informe='A' and informe = @V_informe;
    END

END
GO

Used By

No items found