dbo.backend_abm_fuentes_procesadas

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

10
Name Data Type Length Description
@accion char 1
@id_cendeu_procesado int 4
@fecha_informacion date 3
@fuente varchar 500
@visible int 4
@observaciones varchar -1
@user_id int 4
@IP varchar 100
@id_fuente int 4
@cantidad int 4

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.backend_abm_fuentes_procesadas
     @accion char(1), 
        @id_cendeu_procesado int = null, 
        @fecha_informacion date  = null, 
        @fuente varchar(500)  = null, 
        @visible int  = null,
  @observaciones varchar(max)  = null, 
  @user_id int  = null, 
  @IP varchar(100)    = null,
        @id_fuente int=NULL,
        @cantidad int=NULL

AS

BEGIN
    SET NOCOUNT ON;
    
    if (@accion = 'M') 
        begin
           update fuentes_procesadas
              set fecha_informacion = isnull(@fecha_informacion,fecha_informacion),
      fuente = isnull(@fuente,fuente),
                  visible = isnull(@visible,1), 
            observaciones = isnull(@observaciones, observaciones),
      created_by = isnull(@user_id, created_by),
      ip = isnull(@IP,IP),
                  id_fuente=@id_fuente,
                  cantidad=ISNULL(@cantidad,cantidad)
            where id_cendeu_procesado = @id_cendeu_procesado
   return
        end


  if (@accion = 'I') 
        begin
           select * from fuentes_procesadas 
            where id_cendeu_procesado = @id_cendeu_procesado
   return
        end

  
  if (@accion = 'L') 
        begin
           select * from fuentes_procesadas
            order by fuente
   return
        end

     if (@accion = 'A') 
        begin
        
        insert into fuentes_procesadas 
                    (fecha_informacion, fuente, visible,observaciones, created, created_by,IP,id_fuente,cantidad)
               values
                    (@fecha_informacion, 
     @fuente, 
     isnull(@visible,1), 
     @observaciones, 
     GETDATE(),
     @user_id, 
     @IP,
                    @id_fuente,
                    @cantidad
                    )

     SET @id_cendeu_procesado = SCOPE_IDENTITY()
     select @id_cendeu_procesado as id
   return 
        end 
END

GO

Depends On

1

Used By

No items found