DROP PROCEDURE  IF EXISTS uspGetOrszagTipusEugyintezes 
GO

CREATE PROCEDURE uspGetOrszagTipusEugyintezes 
   @pOrszagId INT
  ,@pTipusId INT
  ,@pTanevId INT
AS
BEGIN
  SET NOCOUNT ON;

  SELECT DictionaryItemBase.ID AS KretaAzonosito
    ,DictionaryItemBase.C_NAME AS Nev
    ,OrszagTipus.C_ISOKOD AS ISO_Alpha3
  FROM T_DICTIONARYITEMBASE_OSSZES DictionaryItemBase
  INNER JOIN T_ORSZAGTIPUS_OSSZES OrszagTipus ON DictionaryItemBase.ID = OrszagTipus.ID
    AND OrszagTipus.C_ALTANEVID = DictionaryItemBase.C_TANEVID
    AND OrszagTipus.TOROLT = 'F'
  WHERE DictionaryItemBase.TOROLT = 'F'
    AND DictionaryItemBase.ID = @pOrszagId
    AND DictionaryItemBase.C_DICTIONARYTYPEID = @pTipusId
    AND DictionaryItemBase.C_TANEVID = @pTanevId
END
GO


