﻿DECLARE @intezmenyId int
DECLARE IntCur CURSOR FOR
  SELECT ID FROM T_INTEZMENY WHERE TOROLT='F'

OPEN IntCur
FETCH NEXT FROM IntCur INTO @intezmenyId

WHILE @@FETCH_STATUS = 0
BEGIN
  EXEC dev.uspGenerateTanevAdatokFromExistingTanev
     @intezmenyId
    ,'2020/2021'
    ,'2019/2020'
    ,1
  FETCH NEXT FROM IntCur INTO @intezmenyId
END
CLOSE IntCur
DEALLOCATE IntCur
