﻿--Migration
DECLARE @IntezmenyID varchar(100)
​
DECLARE keys_cursor CURSOR FOR
SELECT ID as IntezmenyID from T_INTEZMENY
WHERE C_ISARCHIV = 'F' AND TOROLT = 'F'
ORDER BY IntezmenyID
​
OPEN keys_cursor
​
FETCH NEXT FROM keys_cursor
INTO @IntezmenyID
​
WHILE @@FETCH_STATUS = 0
BEGIN
​
    EXEC dev.uspGenerateTanevAdatokFromExistingTanev @IntezmenyID, '2022/2023', '2021/2022', 1
​​
    FETCH NEXT FROM keys_cursor
    INTO @IntezmenyID
​
END
​
CLOSE keys_cursor;
DEALLOCATE keys_cursor;