Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
3| Name | Data Type | Length | Description |
|---|---|---|---|
| @dni | varchar | 50 | |
| @sexo | char | 1 | |
| @dias | int | 4 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/*
exec [RENAPER_PASAPORTE_BUSCAR] '20892565','F'
*/
CREATE OR ALTER PROCEDURE dbo.RENAPER_PASAPORTE_BUSCAR
@dni varchar(50),
@sexo char(1) = '',
@dias int = 60
AS
BEGIN
SET NOCOUNT ON;
SELECT TOP 1
RENAPER_PASAPORTE_INFO.Id as id,
RENAPER_PASAPORTE_INFO.dni,
RENAPER_PASAPORTE_INFO.sexo,
RENAPER_PASAPORTE_INFO.created,
RENAPER_PASAPORTE_INFO.identificacion,
RENAPER_PASAPORTE_INFO.id_padron,
RENAPER_PASAPORTE_INFO.codigo,
RENAPER_PASAPORTE_INFO.mensaje,
nro_pasaporte,
fecha_vencimiento,
padrones.nombre_persona
FROM RENAPER_PASAPORTE_INFO
left join padrones on padrones.id_padron = RENAPER_PASAPORTE_INFO.id_padron
where RENAPER_PASAPORTE_INFO.sexo = @sexo
and RENAPER_PASAPORTE_INFO.dni = @dni
and (@dias = 0 or RENAPER_PASAPORTE_INFO.created >= GETDATE() - @dias)
order by created desc
END
GO
GO
/*
exec [RENAPER_PASAPORTE_BUSCAR] '20892565','F'
*/
CREATE OR ALTER PROCEDURE dbo.RENAPER_PASAPORTE_BUSCAR
@dni varchar(50),
@sexo char(1) = '',
@dias int = 60
AS
BEGIN
SET NOCOUNT ON;
SELECT TOP 1
RENAPER_PASAPORTE_INFO.Id as id,
RENAPER_PASAPORTE_INFO.dni,
RENAPER_PASAPORTE_INFO.sexo,
RENAPER_PASAPORTE_INFO.created,
RENAPER_PASAPORTE_INFO.identificacion,
RENAPER_PASAPORTE_INFO.id_padron,
RENAPER_PASAPORTE_INFO.codigo,
RENAPER_PASAPORTE_INFO.mensaje,
nro_pasaporte,
fecha_vencimiento,
padrones.nombre_persona
FROM RENAPER_PASAPORTE_INFO
left join padrones on padrones.id_padron = RENAPER_PASAPORTE_INFO.id_padron
where RENAPER_PASAPORTE_INFO.sexo = @sexo
and RENAPER_PASAPORTE_INFO.dni = @dni
and (@dias = 0 or RENAPER_PASAPORTE_INFO.created >= GETDATE() - @dias)
order by created desc
END
GO
Depends On
2Used By
No items found