dbo.ws_entidades_operaba

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

1
Name Data Type Length Description
@p_Cuit varchar 20

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.ws_entidades_operaba
@p_Cuit varchar(20)
AS


BEGIN
    SET NOCOUNT ON;
 select subq.codigo_ent, subq.nombre, max(subq.periodo) as periodo
 
  from (select codigo_ent, 
     nombre,
     max(fec_inf) as periodo
 from cendeu 
 inner join EntidadesBancarias on
      convert(int,cendeu.codigo_ent) = EntidadesBancarias.id_banco 
 where iden = @p_Cuit
   and vigente = 1
 group by cendeu.codigo_ent, EntidadesBancarias.nombre
 union 
 select codigo_ent, 
     nombre,
     max(fec_inf) as periodo
 from cendeu_temp cendeu
 inner join EntidadesBancarias on
      convert(int,cendeu.codigo_ent) = EntidadesBancarias.id_banco 
 where iden = @p_Cuit
   and vigente = 1
 group by cendeu.codigo_ent, EntidadesBancarias.nombre
 ) as subq

 group by subq.codigo_ent, subq.nombre

END 

GO

Used By

No items found