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_identificador | varchar | 100 | |
| @p_todos_los_paises | tinyint | 1 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: Leonel Turchetto
-- Create date: 2017-05-19
-- Description: Búsqueda de Padron Avanzado
-- =============================================
CREATE OR ALTER PROCEDURE dbo.busqueda_padron
@p_identificador varchar(100),
@p_todos_los_paises tinyint
AS
BEGIN
SET NOCOUNT ON;
if(@p_todos_los_paises = 1)
begin
SELECT top 300 identificacion,pre_clave, suf_clave,cuerpo_clave,nombre_persona,padrones.identificador,id_padron,identificadores.identificador,tipo_persona from dbo.padrones inner join identificadores on
identificadores.identificador = padrones.identificador
WHERE CONTAINS((nombre_persona,identificacion,cuerpo_clave),@p_identificador) and habilitado = 1
end
else
begin
SELECT top 300 identificacion,pre_clave, suf_clave,cuerpo_clave,nombre_persona,padrones.identificador,id_padron,identificadores.identificador,tipo_persona from dbo.padrones inner join identificadores on
identificadores.identificador = padrones.identificador
WHERE CONTAINS((nombre_persona,identificacion,cuerpo_clave),@p_identificador) and country_code in ('AR') and habilitado = 1
end
END
GO
GO
-- =============================================
-- Author: Leonel Turchetto
-- Create date: 2017-05-19
-- Description: Búsqueda de Padron Avanzado
-- =============================================
CREATE OR ALTER PROCEDURE dbo.busqueda_padron
@p_identificador varchar(100),
@p_todos_los_paises tinyint
AS
BEGIN
SET NOCOUNT ON;
if(@p_todos_los_paises = 1)
begin
SELECT top 300 identificacion,pre_clave, suf_clave,cuerpo_clave,nombre_persona,padrones.identificador,id_padron,identificadores.identificador,tipo_persona from dbo.padrones inner join identificadores on
identificadores.identificador = padrones.identificador
WHERE CONTAINS((nombre_persona,identificacion,cuerpo_clave),@p_identificador) and habilitado = 1
end
else
begin
SELECT top 300 identificacion,pre_clave, suf_clave,cuerpo_clave,nombre_persona,padrones.identificador,id_padron,identificadores.identificador,tipo_persona from dbo.padrones inner join identificadores on
identificadores.identificador = padrones.identificador
WHERE CONTAINS((nombre_persona,identificacion,cuerpo_clave),@p_identificador) and country_code in ('AR') and habilitado = 1
end
END
GO
Depends On
2Used By
No items found