dbo.Mantenimiento_Concursos_y_Quiebras_txt2

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

2
Name Data Type Length Description
@fechad date 3
@fechah date 3

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- [Mantenimiento_Concursos_y_Quiebras_txt] '2018-05-28','2018-05-30'
CREATE OR ALTER PROCEDURE dbo.Mantenimiento_Concursos_y_Quiebras_txt2
@fechad date,
@fechah date

AS
BEGIN
  SET NOCOUNT ON;

--EXPEDIENTE            ALFANUMERICO    12      POSICIONES.
--JUZGADO               NUMERICO        3       POSICIONES.
--SECRETARIA            ALFANUMERICO    3       POSICIONES.
--JURISDICCION          ALFANUMERICO    30      POSICIONES.
--CONCURSADO            ALFANUMERICO    80      POSICIONES.
--NUMCLIEN              NUMERICO        10      POSICIONES.
--CUIT                  NUMERICO        13      POSICIONES.
--TIPODOC               ALFANUMERICO    3       POSICIONES.
--NRODOC                NUMERICO        8       POSICIONES.
--SITUACION             ALFANUMERICO    2       POSICIONES.
--PETICIONANTE          ALFANUMERICO    70      POSICIONES.
--TIPROCESO             ALFANUMERICO    2       POSICIONES.
--PROCESO               ALFANUMERICO    43      POSICIONES.
--SINDICO               ALFANUMERICO    70      POSICIONES.
--DOMICIL-SINDICO       ALFANUMERICO    80      POSICIONES.
--PRESENTACION          ALFANUMERICO    8       POSICIONES.
--APERTURA              ALFANUMERICO    8       POSICIONES.
--FECVER                ALFANUMERICO    8       POSICIONES.
--ARTICULO35            ALFANUMERICO    8       POSICIONES.
--ARTICULO39            ALFANUMERICO    8       POSICIONES.
--AUDIENCIA             ALFANUMERICO    8       POSICIONES.

  if(@fechad is null)
  begin
 set @fechad = CONVERT(date, getdate())
  end 
  if(@fechah is null)
  begin
 set @fechah = CONVERT(date, getdate())
  end 

  


 select distinct 
 left(ltrim(rtrim(dbo.fn_StripCharacters(juicios.expediente, '^0-9/'))) + space(12), 12) as Expediente,
 right('000'+(cast(juicios.juzgado as varchar)),3)  as Juzgado,
 isnull(case right('000'+(cast(juicios.secretaria as varchar)),3)
 when 'ICA' then '000'
 else right('000'+(cast(juicios.secretaria as varchar)),3) 
 end,'000') as Secretaria,
 upper(left(isnull(rtrim(juicios.localidad_del_juzgado),'')+space(30),30)) as Jurisdiccion,
 upper(left(isnull(rtrim(juicios.demandado),'')+space(80),80)) as Concursado,
 '0000000000' as Numclien,
 right('0000000000000'+(cast(juicios.cuit_demandado as varchar)),13) as Cuit,
 '   ' as Tipdoc,
 '00000000' as Nrodoc,
 '  ' as Situacion,
 upper(left(isnull(rtrim(juicios.actor),'')+space(70),70)) as Peticionante,
 right('00'+(cast(juicios.tipo_de_proceso as varchar)),2) as Tiproceso,
 upper(left(isnull(juicios.proceso,'')+space(43),43)) as Proceso,
 upper(left(isnull(juicios.nombre_y_apellido_del_sindico,'')+space(70),70)) as Sindico,
 upper(left(isnull(juicios.domicilio_del_sindico,'')+space(80),80)) as DomicilSindico,
 space(8) as Presentacion,
 isnull(convert(varchar(8),juicios.fecha_causa,112),space(8))     as Apertura,
 isnull(convert(varchar(8),convert(date,juicios.verificaciones),112),space(8))  as Fecver,
 isnull(convert(varchar(8),juicios.inf_articulo_35,112),space(8)) as Artitulo35, 
 isnull(convert(varchar(8),juicios.inf_articulo_39,112),space(8)) as Articulo39,
 isnull(convert(varchar(8),juicios.aud_informativa,112),space(8)) as Audiencia

 from juicios 

 where tipo_de_proceso is not null 
 and visible = 1
 and convert(date,created) between @fechad and @fechah
 and isnull(cuit_demandado, '') != ''
 and isnull(id_tipo_causa,'') != 'DS'
 and isnull(cau_codigo,'') != 'DS'
 and juzgado is not null and juzgado != '' 



END 

GO

Used By

No items found