dbo.screening_insertar

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

4
Name Data Type Length Description
@cliente int 4
@cuit varchar 20
@fecha date 3
@afip bit 1

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
--delete from procesos_masivos 
--select * from procesos_masivos 
/*
exec [procesos_masivos_insertar] 2254875, '', '4520165', 'TENEMBAUM ENRIQU','',94437923
*/

CREATE OR ALTER PROCEDURE dbo.screening_insertar
@cliente int,
@cuit    varchar(20), 
@fecha   date = null, 
@afip bit = 1
AS

BEGIN
BEGIN TRY
    SET NOCOUNT ON;
 if (@fecha is null) set @fecha = getdate(); 
 insert into procesos_cuit(cliente, fecha, cuit) values (@cliente, @fecha, @cuit) 
 if (@afip = 1)
  insert into consultar_afip (proceso, fecha, procesado, prioridad,cuit) values ('SCREENING',@fecha,0,1,@cuit)
END TRY
BEGIN CATCH
 SELECT ERROR_NUMBER() as error
END CATCH
END
/*
select * from procesos_cuit
*/

GO

Used By

No items found