dbo.LN_BACKUP_gestiones_proceso

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

6
Name Data Type Length Description
@accion varchar 20
@id int 4
@procesado_ic bit 1
@procesado_bkp bit 1
@cliente int 4
@country varchar 2

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.LN_BACKUP_gestiones_proceso 
@accion varchar(20),
@id int = null,
@procesado_ic bit = null,
@procesado_bkp bit = null,
@cliente int = null,
@country varchar(2) = null

AS
BEGIN
    SET NOCOUNT ON;

if (@accion = 'LISTAR')
BEGIN
--  AMX-LED-GESTION-2023.xlsx
 select TOP 500 * from LN_BACKUP_gestiones_procesar where country_code in ('AR','UY','PY') and cliente =5546348 /* and fecha_proceso_ic is null*/ order by country_code, Nombre
-- delete LN_BACKUP_gestiones_procesar where country_code='AR' and cliente =5546348

 --where country_code=@country and cliente = @cliente

/*ALTER TABLE LN_BACKUP_gestiones_procesar ADD country_code varchar(2) null
ALTER TABLE LN_BACKUP_gestiones_procesar ADD cliente int null
ALTER TABLE LN_BACKUP_gestiones_procesar ADD procesado bit not null default(0)
*/





 /*WHERE RIESGO = 'SIN CALCULAR (P)' order by nombre --where fecha_proceso_ic is null*/
END
--update LN_BACKUP_gestiones_procesar set fecha_proceso_ic=null where idReg>191

if (@accion = 'UPDLIST' AND @procesado_ic IS NOT NULL and @id is not null)
BEGIN
 UPDATE LN_BACKUP_gestiones_procesar set fecha_proceso_ic=getdate() where idReg=@id
END

if (@accion = 'UPDLIST' AND @procesado_bkp IS NOT NULL and @id is not null)
BEGIN
 UPDATE LN_BACKUP_gestiones_procesar set fecha_proceso_bkp=getdate() where idReg=@id
END

END  
GO

Used By

No items found