DROP PROCEDURE  IF EXISTS uspGetFeltoltottFajlokSzamaByTanitasiOraId 
GO

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

  SELECT COUNT(1)
  FROM T_DKT_FILE_OSSZES f
  INNER JOIN T_ORAFILE_OSSZES orf ON f.ID = orf.C_DKT_FILEID AND orf.TOROLT = 'F'
  WHERE orf.C_TANITASIORAID = @pTanitasiOraId
    AND f.C_INTEZMENYID = @pIntezmenyId
    AND f.C_TANEVID = @pTanevId
    AND f.TOROLT = 'F'
END
GO


