dbo.backend_obtener_integrantes_de_SC_sin_cuit

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: <Samuel Gonzalez>
-- Create date: <14 Dic 2017>
-- Description: <obtener todos los integrantes con "nombre" o "documento" en la tabla sociedades_constituciones>
-- =============================================
CREATE OR ALTER PROCEDURE dbo.backend_obtener_integrantes_de_SC_sin_cuit
 -- Add the parameters for the stored procedure here
 
AS
BEGIN

 SET NOCOUNT ON;

    -- Insert statements for procedure here
 select top 100
  sc.id_fide              as id_tabla, 
        'sociedades_constituciones' as tabla, 
        'integrante'            as nombre_columna,
  sc.nombre_integrante    as nombre_persona, 
  IIF((sc.documento_integrante is not null and sc.documento_integrante != ''), sc.documento_integrante , sc.nrdoc_int ) as dni, 
  sc.domicilio_integrante as domicilio,
        sc.localidad_integrante as localidad,
  IIF((sc.provincia_integrante is not null and sc.provincia_integrante != ''), sc.provincia_integrante , sc.provincia_int ) as provincia,
        sc.flag_int             as flag
 from sociedades_constituciones sc
 where (sc.nombre_integrante is not null) and (sc.nombre_integrante != '')
  and (sc.cuit_int is null)
        and (sc.flag_int is null)

    union 

    select top 100
  sc.id_fide              as id_tabla, 
        'sociedades_constituciones' as tabla, 
        'integrante'            as nombre_columna,
  sc.nombre_integrante    as nombre_persona, 
  IIF((sc.documento_integrante is not null and sc.documento_integrante != ''), sc.documento_integrante , sc.nrdoc_int ) as dni, 
  sc.domicilio_integrante as domicilio,
        sc.localidad_integrante as localidad,
  IIF((sc.provincia_integrante is not null and sc.provincia_integrante != ''), sc.provincia_integrante , sc.provincia_int ) as provincia,
        sc.flag_int             as flag
 from sociedades_constituciones sc
 where (sc.nombre_integrante is not null) and (sc.nombre_integrante != '')
  and (sc.cuit_int != '')
        and (sc.flag_int is null)

    union 

    select top 100
  sc.id_fide              as id_tabla, 
        'sociedades_constituciones' as tabla, 
        'integrante'            as nombre_columna,
  sc.nombre_integrante    as nombre_persona, 
  IIF((sc.documento_integrante is not null and sc.documento_integrante != ''), sc.documento_integrante , sc.nrdoc_int ) as dni, 
  sc.domicilio_integrante as domicilio,
        sc.localidad_integrante as localidad,
  IIF((sc.provincia_integrante is not null and sc.provincia_integrante != ''), sc.provincia_integrante , sc.provincia_int ) as provincia,
        sc.flag_int             as flag
 from sociedades_constituciones sc
 where (sc.nombre_integrante is not null) and (sc.nombre_integrante != '')
  and (sc.cuit_integrante is null)
        and (sc.flag_int is null)

    union 

    select top 100
  sc.id_fide              as id_tabla, 
        'sociedades_constituciones' as tabla, 
        'integrante'            as nombre_columna,
  sc.nombre_integrante    as nombre_persona, 
  IIF((sc.documento_integrante is not null and sc.documento_integrante != ''), sc.documento_integrante , sc.nrdoc_int ) as dni, 
  sc.domicilio_integrante as domicilio,
        sc.localidad_integrante as localidad,
  IIF((sc.provincia_integrante is not null and sc.provincia_integrante != ''), sc.provincia_integrante , sc.provincia_int ) as provincia,
        sc.flag_int             as flag
 from sociedades_constituciones sc
 where (sc.nombre_integrante is not null) and (sc.nombre_integrante != '')
  and (sc.cuit_integrante != '')
        and (sc.flag_int is null)
END

GO

Used By

No items found