DROP PROCEDURE IF EXISTS uspGetIsPortasMunkakor
GO

CREATE PROCEDURE uspGetIsPortasMunkakor
   @pAlkalmazottId AS INT
  ,@pTanevId AS INT
  ,@pPortasMunkakorTipusId AS INT
AS
BEGIN

  SET NOCOUNT ON;

  IF EXISTS(
    SELECT 1
    FROM
      T_MUNKAUGYIADATOK_OSSZES 
    WHERE
      TOROLT = 'F'
      AND C_ALKALMAZOTTID = @pAlkalmazottId
      AND C_TANEVID = @pTanevId
      AND C_MUNKAKORTIPUSA = @pPortasMunkakorTipusId
  )
    SELECT 1
  ELSE
    SELECT 0

END
GO

