DROP PROCEDURE IF EXISTS uspGetAlkalmazottFeladatEllatasiHelyId 
GO
  CREATE PROCEDURE uspGetAlkalmazottFeladatEllatasiHelyId
      @pTanevId INT
     ,@pAlkalmazottId INT
    
  AS
  BEGIN
    SET NOCOUNT ON;

    SELECT ma.C_FELADATELLATASIHELYID
    FROM T_ALKALMAZOTT_OSSZES a
    INNER JOIN T_MUNKAUGYIADATOK_OSSZES ma ON ma.C_ALKALMAZOTTID = a.ID AND ma.TOROLT = 'F' AND ma.C_TANEVID = a.C_ALTANEVID
    WHERE a.ID = @pAlkalmazottId AND a.TOROLT = 'F' AND a.C_ALTANEVID = @pTanevId
  END
GO


