DROP PROCEDURE  IF EXISTS uspIsExistsHaziFeladatCsatolmany 
GO

CREATE PROCEDURE uspIsExistsHaziFeladatCsatolmany 
   @pTanevId INT
  ,@pHaziFeladatId INT
  ,@pCsatolmanyId INT
AS
BEGIN
  SET NOCOUNT ON;

  IF EXISTS (
      SELECT 1
      FROM T_DKT_FELADATFILE_OSSZES hfcs
      WHERE hfcs.C_FELADATID = @pHaziFeladatId
        AND hfcs.C_FILEID = @pCsatolmanyId
        AND hfcs.C_TANEVID = @pTanevId
        AND hfcs.TOROLT = 'F'
      )
    SELECT 1
  ELSE
    SELECT 0
END
GO


