DROP PROCEDURE  IF EXISTS uspGetCsatolmanyokForHaziFeladatDataSet 
GO

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

  SELECT cs.ID AS ID
    ,cs.C_FILENEV AS FajlNev
    ,cs.C_EXTENSION AS FajlKiterjesztes
    ,cs.C_FILESIZEBYTE AS FajlMeret
    ,cs.C_FELTOLTESDATUM AS FeltoltesDatum
  FROM T_DKT_FELADAT_OSSZES hf
  INNER JOIN T_DKT_FELADATFILE_OSSZES hfcs ON hfcs.C_FELADATID = hf.ID
    AND hfcs.TOROLT = 'F'
  INNER JOIN T_DKT_FILE_OSSZES cs ON cs.ID = hfcs.C_FILEID
    AND cs.TOROLT = 'F'
  WHERE hf.ID = @pHaziFeladatId
    AND hf.C_FELADATTIPUSID = 0
    AND hf.C_TANEVID = @pTanevId
    AND hf.C_INTEZMENYID = @pIntezmenyId
    AND hf.TOROLT = 'F'
END
GO


