Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
25| Name | Data Type | Length | Description |
|---|---|---|---|
| @pepe | int | 4 | |
| @p_id_boletin | int | 4 | |
| @p_documento_soc | varchar | 20 | |
| @p_razon_social | varchar | 180 | |
| @p_domicilio_sociedad | varchar | 140 | |
| @p_localidad_sociedad | varchar | 50 | |
| @p_provincia_sociedad | varchar | 50 | |
| @p_fecha_publicacion | varchar | 10 | |
| @p_titulo | varchar | 120 | |
| @p_tipo_publicacion | varchar | 60 | |
| @p_capita_social | varchar | 20 | |
| @p_fecha_constitucion | varchar | 10 | |
| @p_cargo | varchar | 50 | |
| @p_nombre_integrante | varchar | 150 | |
| @p_documento_integrante | varchar | 50 | |
| @p_domicilio_integrante | varchar | 150 | |
| @p_localidad_integrante | varchar | 50 | |
| @p_provincia_integrante | varchar | 50 | |
| @p_fuente | varchar | 30 | |
| @p_codigo_archivo | varchar | 20 | |
| @p_contenido_archivo | text | -1 | |
| @p_nombre_file | varchar | 200 | |
| @p_ultdir | varchar | 1 | |
| @p_user_id | int | 4 | |
| @p_cargo_detalle | varchar | 50 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/*
select * from sociedades_constituciones where fuente = 'AI'
select * from sociedades_constituciones_AI where fuente = 'AI'
--delete sociedades_constituciones_AI
--delete sociedades_constituciones where fuente = 'AI'
--delete socios_AI
--delete socios where fuente = 'AI' where created > '2021-04-07 14:33:16.710'
select * from socios where fuente = 'AI' created > '2021-04-07 13:20:16.710' order by created desc
select * from socios_AI
*/
/*
-- delete sociedades_constituciones where fuente = 'AI' and created > '2021-05-01'
-- delete socios where fuente='AI' and created > '2021-05-01'
delete sociedades_constituciones_AI where fuente = 'AI'
delete socios_AI where fuente='AI'
*/
CREATE OR ALTER PROCEDURE dbo.sociedades_edictos_insertar2
--@out_error_number INT = 0 OUTPUT,
@pepe int,
@p_id_boletin int,
@p_documento_soc varchar(20),
@p_razon_social varchar(180),
@p_domicilio_sociedad varchar(140),
@p_localidad_sociedad varchar(50),
@p_provincia_sociedad varchar(50),
/*@p_fecha_publicacion date,*/
@p_fecha_publicacion varchar(10),
@p_titulo varchar(120),
@p_tipo_publicacion varchar(60),
@p_capita_social varchar(20),
/*@p_fecha_constitucion date,*/
@p_fecha_constitucion varchar(10),
@p_cargo varchar(50),
@p_nombre_integrante varchar(150),
@p_documento_integrante varchar(50),
@p_domicilio_integrante varchar(150),
@p_localidad_integrante varchar(50),
@p_provincia_integrante varchar(50),
@p_fuente varchar(30),
@p_codigo_archivo varchar(20),
@p_contenido_archivo text,
@p_nombre_file varchar(200),
@p_ultdir varchar(1),
@p_user_id int,
@p_cargo_detalle varchar(50)
AS
BEGIN
BEGIN TRY
SET NOCOUNT ON;
DECLARE @periodo_ano VARCHAR(4)=NULL
DECLARE @periodo_mes VARCHAR(2)=NULL
/*si la razón social es mayor a 2 caracteres asumimos que es cierta y la insertamos. Sino se inserta en la tabla aux para revisarla luego*/
if (len(ltrim(rtrim(@p_razon_social))) < 2)
begin
set @p_razon_social = null
end
if (len(ltrim(rtrim(@p_documento_soc))) < 11)
begin
set @p_documento_soc = null
end
if (len(ltrim(rtrim(@p_documento_integrante))) < 11)
begin
set @p_documento_integrante = null
end
if (len(ltrim(rtrim(@p_fecha_publicacion))) < 10)
begin
set @p_fecha_publicacion = null
end
/* ACÁ SE INSERTA EN LA TABLA SOCIOS */
/* SI LOS DATOS NO SON NULOS LO INSERTAMOS EN LA TABLA DE SOCIOS Y SINO EN LA TABLA DE SOCIOS AUXILIAR*/
if (@p_documento_soc is not null and @p_documento_integrante is not null and @p_fecha_publicacion is not null and @p_cargo !='ZZZ')
begin
/* ANTES DE INSERTAR DEBEMOS PASAR TODOS LOS REGISTROS MAS VIEJOS A ULTIMO DIRECTORIO N */
begin try
set @periodo_ano=substring(@p_fecha_publicacion,1,4)
set @periodo_mes=substring(@p_fecha_publicacion,6,2)
/*
update socios set c04_ultimo='N',modified=getdate(),modified_by=15342812,c04_periodo_desde=c04_periodo_ano + '-' + c04_periodo_mes
where c01_cuit=@p_documento_soc and c01_cuit_soc=@p_documento_integrante
and (c04_periodo_desde<substring(@p_fecha_publicacion,1,7) or (c04_periodo_ano<@periodo_ano and c04_periodo_mes<@periodo_mes)) and isnull(visible,1)=1
*/
SELECT 'PASO A N'
end try
begin catch
end catch
/* FIN DE ACTUALIZAR LOS DIRECTORIOS ANTERIORES
insert into socios (c01_cuit, c01_cuit_soc, car_codigo,c04_ultimo, c04_periodo_desde,visible, created, created_by,fuente,c04_periodo_ano,c04_periodo_mes)
values (@p_documento_soc,@p_documento_integrante,@p_cargo,@p_ultdir,substring(@p_fecha_publicacion,1,7),1,getdate(),@p_user_id,@p_fuente,@periodo_ano,@periodo_mes)
*/
SELECT 'INSERTO EN S'
end
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER()
END CATCH
END
GO
GO
/*
select * from sociedades_constituciones where fuente = 'AI'
select * from sociedades_constituciones_AI where fuente = 'AI'
--delete sociedades_constituciones_AI
--delete sociedades_constituciones where fuente = 'AI'
--delete socios_AI
--delete socios where fuente = 'AI' where created > '2021-04-07 14:33:16.710'
select * from socios where fuente = 'AI' created > '2021-04-07 13:20:16.710' order by created desc
select * from socios_AI
*/
/*
-- delete sociedades_constituciones where fuente = 'AI' and created > '2021-05-01'
-- delete socios where fuente='AI' and created > '2021-05-01'
delete sociedades_constituciones_AI where fuente = 'AI'
delete socios_AI where fuente='AI'
*/
CREATE OR ALTER PROCEDURE dbo.sociedades_edictos_insertar2
--@out_error_number INT = 0 OUTPUT,
@pepe int,
@p_id_boletin int,
@p_documento_soc varchar(20),
@p_razon_social varchar(180),
@p_domicilio_sociedad varchar(140),
@p_localidad_sociedad varchar(50),
@p_provincia_sociedad varchar(50),
/*@p_fecha_publicacion date,*/
@p_fecha_publicacion varchar(10),
@p_titulo varchar(120),
@p_tipo_publicacion varchar(60),
@p_capita_social varchar(20),
/*@p_fecha_constitucion date,*/
@p_fecha_constitucion varchar(10),
@p_cargo varchar(50),
@p_nombre_integrante varchar(150),
@p_documento_integrante varchar(50),
@p_domicilio_integrante varchar(150),
@p_localidad_integrante varchar(50),
@p_provincia_integrante varchar(50),
@p_fuente varchar(30),
@p_codigo_archivo varchar(20),
@p_contenido_archivo text,
@p_nombre_file varchar(200),
@p_ultdir varchar(1),
@p_user_id int,
@p_cargo_detalle varchar(50)
AS
BEGIN
BEGIN TRY
SET NOCOUNT ON;
DECLARE @periodo_ano VARCHAR(4)=NULL
DECLARE @periodo_mes VARCHAR(2)=NULL
/*si la razón social es mayor a 2 caracteres asumimos que es cierta y la insertamos. Sino se inserta en la tabla aux para revisarla luego*/
if (len(ltrim(rtrim(@p_razon_social))) < 2)
begin
set @p_razon_social = null
end
if (len(ltrim(rtrim(@p_documento_soc))) < 11)
begin
set @p_documento_soc = null
end
if (len(ltrim(rtrim(@p_documento_integrante))) < 11)
begin
set @p_documento_integrante = null
end
if (len(ltrim(rtrim(@p_fecha_publicacion))) < 10)
begin
set @p_fecha_publicacion = null
end
/* ACÁ SE INSERTA EN LA TABLA SOCIOS */
/* SI LOS DATOS NO SON NULOS LO INSERTAMOS EN LA TABLA DE SOCIOS Y SINO EN LA TABLA DE SOCIOS AUXILIAR*/
if (@p_documento_soc is not null and @p_documento_integrante is not null and @p_fecha_publicacion is not null and @p_cargo !='ZZZ')
begin
/* ANTES DE INSERTAR DEBEMOS PASAR TODOS LOS REGISTROS MAS VIEJOS A ULTIMO DIRECTORIO N */
begin try
set @periodo_ano=substring(@p_fecha_publicacion,1,4)
set @periodo_mes=substring(@p_fecha_publicacion,6,2)
/*
update socios set c04_ultimo='N',modified=getdate(),modified_by=15342812,c04_periodo_desde=c04_periodo_ano + '-' + c04_periodo_mes
where c01_cuit=@p_documento_soc and c01_cuit_soc=@p_documento_integrante
and (c04_periodo_desde<substring(@p_fecha_publicacion,1,7) or (c04_periodo_ano<@periodo_ano and c04_periodo_mes<@periodo_mes)) and isnull(visible,1)=1
*/
SELECT 'PASO A N'
end try
begin catch
end catch
/* FIN DE ACTUALIZAR LOS DIRECTORIOS ANTERIORES
insert into socios (c01_cuit, c01_cuit_soc, car_codigo,c04_ultimo, c04_periodo_desde,visible, created, created_by,fuente,c04_periodo_ano,c04_periodo_mes)
values (@p_documento_soc,@p_documento_integrante,@p_cargo,@p_ultdir,substring(@p_fecha_publicacion,1,7),1,getdate(),@p_user_id,@p_fuente,@periodo_ano,@periodo_mes)
*/
SELECT 'INSERTO EN S'
end
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER()
END CATCH
END
GO
Depends On
No items found
Used By
No items found