DROP PROCEDURE  IF EXISTS uspGetKozteruletJellege 
GO

CREATE PROCEDURE uspGetKozteruletJellege
   @pTipusId INT
  ,@pId 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.ID = @pId
    AND DictionaryItemBase.C_TANEVID = @pTanevId
    AND DictionaryItemBase.TOROLT ='F'
END
GO


