DROP PROCEDURE  IF EXISTS uspGetKozossegiSzolgalatTevekenyseg 
GO

CREATE PROCEDURE uspGetKozossegiSzolgalatTevekenyseg
   @pAzonosito INT
  ,@pTipusId INT
  ,@pTanevId INT
AS
BEGIN
  SET NOCOUNT ON;

  SELECT DictionaryItemBase.ID AS KretaAzonosito
    ,DictionaryItemBase.C_NAME AS Megnevezes
  FROM T_DICTIONARYITEMBASE_OSSZES DictionaryItemBase
  INNER JOIN T_INTEZMENY_OSSZES Intezmeny ON Intezmeny.ID = DictionaryItemBase.C_INTEZMENYID
    AND DictionaryItemBase.C_DICTIONARYTYPEID = @pTipusId
    AND Intezmeny.TOROLT = 'F'
  WHERE DictionaryItemBase.ID = @pAzonosito
    AND DictionaryItemBase.TOROLT = 'F'
    AND DictionaryItemBase.C_TANEVID = @pTanevId
END
GO


