dbo.cendeu_rectificacion_masiva

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_iden varchar 11
@p_codigo_ent varchar 5
@p_fec_inf varchar 6
@p_situacion varchar 2
@p_deuda_total numeric 9
@p_usuario varchar 20

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- Create the stored procedure in the specified schema
CREATE OR ALTER PROCEDURE dbo.cendeu_rectificacion_masiva
    @p_iden VARCHAR(11),
    @p_codigo_ent VARCHAR(5),
    @p_fec_inf VARCHAR(6),
    @p_situacion VARCHAR(2),
    @p_deuda_total numeric(12,1), 
    @p_usuario varchar(20)
-- add more stored procedure parameters here
AS
BEGIN
    SET NOCOUNT ON;
    SET ANSI_WARNINGS OFF;
    -- body of the stored procedure
    DECLARE @count_situacion INT;
    SELECT @count_situacion = COUNT(*) FROM cendeu WHERE iden=@p_iden and CONVERT(INT,codigo_ent)=CONVERT(INT,@p_codigo_ent) and fec_inf=@p_fec_inf and vigente=1 and situacion=@p_situacion and id_fuente=2;
    --
    IF ( @count_situacion = 0 )
    BEGIN
        INSERT INTO cendeu (codigo_ent, fec_inf, tipo, iden, situacion, prestamos, particip, garotor, o_cptos, garprefa, garprefb, cgarprefa, cgarprefb, sincgarpre, previ, deuda_total, vigente, modified, id_persona, modified_by, observaciones, id_fuente)
     VALUES (@p_codigo_ent, @p_fec_inf, '11', @p_iden, @p_situacion, '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', @p_deuda_total, '1', GETDATE(), NULL, @p_usuario, NULL, '2')
        SELECT '0' as error, 'El registro se grabó satisfactoriamente' as mensaje
        RETURN;
    END
    SELECT '1' as error, 'No se grabo' as mensaje
    RETURN;
END
GO

Depends On

1

Used By

No items found