dbo.afip_padrones

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

3
Name Data Type Length Description
@cuit varchar 20
@nombre varchar 200
@estado bit 1

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.afip_padrones
@cuit varchar(20),
@nombre varchar(200),
@estado bit
AS


BEGIN
    SET NOCOUNT ON;
 declare @id_padron int
 set @id_padron = (select top 1 id_padron from padrones where identificacion = @cuit and habilitado = 1 order by id_padron)
 if (@id_padron is not null)
 begin
  update padrones set nombre_persona = @nombre,
       afip_activo = @estado,
       ismodified = GETDATE()
   where id_padron = @id_padron
 end
 /*
  else
  begin
  set @id_padron = (select top 1 id_padron from padrones where identificacion = @cuit and habilitado = 0 order by id_padron)
  if (@id_padron is not null) 
  begin
  update padrones set nombre_persona = @nombre,
  afip_activo = @estado,
  habilitado = 1, 
  ismodified = GETDATE()
   where id_padron = @id_padron
  end
  end            
  */
               
 return '0'
END 

GO

Depends On

1

Used By

No items found