DROP PROCEDURE  IF EXISTS uspGetErettsegiSzintekForComboBox 
GO

CREATE PROCEDURE uspGetErettsegiSzintekForComboBox
   @pIntezmenyId INT
  ,@pTanevId INT
AS
BEGIN
  SET NOCOUNT ON;

  SELECT Szint.ID ID
    ,DictionaryItem.C_NAME Nev
  FROM T_ERETTSEGISZINT_OSSZES Szint
  LEFT JOIN T_DICTIONARYITEMBASE_OSSZES DictionaryItem ON DictionaryItem.ID = Szint.ID
    AND DictionaryItem.TOROLT = 'F'
  WHERE Szint.TOROLT = 'F'
    AND Szint.C_ALINTEZMENYID = @pIntezmenyId
    AND Szint.C_ALTANEVID = @pTanevId
    AND DictionaryItem.C_TANEVID = @pTanevId
  ORDER BY DictionaryItem.C_ORDER ASC
    ,Nev ASC
END
GO


