DROP PROCEDURE IF EXISTS uspGetCsengetesiRendEsOrak
GO
  CREATE PROCEDURE uspGetCsengetesiRendEsOrak
     @pCsengetesirendId INT
    ,@pOraszamId INT
    ,@pTanevId INT
  AS
  BEGIN
    SET NOCOUNT ON;

    SELECT cs.C_KEZDETE AS Kezdete
      ,cs.C_VEGE AS Vege
    FROM T_CSENGETESIREND_OSSZES r
    LEFT JOIN T_CSENGETESIRENDORA_OSSZES cs ON r.ID = cs.C_CSENGETESIRENDID
    WHERE cs.TOROLT = 'F'
      AND r.TOROLT = 'F'
      AND C_ORASZAM = @pOraszamId
      AND r.ID = @pCsengetesirendId
      AND r.C_TANEVID = @pTanevId
  END
GO


