dbo.obtener_morosos

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

2
Name Data Type Length Description
@p_Cuit varchar 20
@anios int 4

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/*
exec obtener_morosos '20138069207'
*/

CREATE OR ALTER PROCEDURE  dbo.obtener_morosos
@p_Cuit varchar(20), 
@anios int = 2
AS
BEGIN
 SELECT distinct upper(denominacion_entidad) as entidad, 
     fecha_info as fecha, 
           CONVERT(varchar, fecha_info, 103) AS fecha_dmy,
     case proceso_judicial
     when 1 then 'Información sometida a proceso juidicial (Artículo 38, inciso 3 Ley 25326)'
     when 2 then 'Información sometida a revisión (Artículo 16, inciso 6 Ley 25326)'
     else NULL
     end as observaciones 
    FROM   morosos_bcra
 WHERE  cuit = @p_cuit 
 AND    visible = 1
 AND    fecha_info >= getdate() - (365*@anios) 

 ORDER BY entidad, fecha
END

GO

Depends On

1

Used By

No items found