DROP PROCEDURE  IF EXISTS uspGetKozossegiSzolgalatTevekenysegek 
GO

CREATE PROCEDURE uspGetKozossegiSzolgalatTevekenysegek
   @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 Intezmeny.TOROLT = 'F' 
    AND DictionaryItemBase.C_DICTIONARYTYPEID = @pTipusId
  WHERE DictionaryItemBase.TOROLT = 'F'
    AND DictionaryItemBase.C_TANEVID = @pTanevId
END
GO


