DROP PROCEDURE IF EXISTS uspGetKovTanevIdByAktTanevId
GO
  CREATE PROCEDURE uspGetKovTanevIdByAktTanevId
    @pId INT
  AS
  BEGIN
    SET NOCOUNT ON;

    SELECT ID
    FROM T_ALKALMAZOTT_OSSZES
    WHERE ELOZOTANEVIREKORDID = @pId
      AND TOROLT = 'F'
  END
GO

