dbo.obtener_paises_identificadores

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_code varchar 10

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.obtener_paises_identificadores  
@p_code varchar(10)  = null 

AS
BEGIN
    SET NOCOUNT ON;
 if (@p_code is null) 
  select country.country_code as pai_codigo, 
        upper(country_name)as pai_nombre, 
     codigo_ifx as codigo_numerico,
     identificadores.identificador,identificadores.abreviatura 
     from country INNER JOIN identificadores ON (country.country_code=identificadores.country_code and identificadores.se_usa=1 and country.se_usa=1)
 order by pai_nombre
 else 
  select country.country_code as pai_codigo, 
        upper(country_name)as pai_nombre, 
     codigo_ifx as codigo_numerico,
     identificadores.identificador,identificadores.abreviatura 
     from country INNER JOIN identificadores ON (country.country_code=identificadores.country_code and identificadores.se_usa=1 and country.se_usa=1)
     where country.country_code = @p_code
 
END

GO

Used By

No items found