﻿DECLARE intezmenytanevekCursor CURSOR LOCAL FOR 
	SELECT C_INTEZMENYID, C_TANEVID
		FROM T_INTEZMENYADATOK

DECLARE @intezmenyId int, @tanevId int

OPEN intezmenytanevekCursor  
FETCH NEXT FROM intezmenytanevekCursor INTO @intezmenyId, @tanevId

WHILE @@FETCH_STATUS = 0 
BEGIN  
	PRINT 'INTÉZMÉNY ID: ' + CAST(@intezmenyId AS NVARCHAR(10)) + ', TANÉV ID: ' + CAST(@tanevId AS NVARCHAR(10))
    EXEC sp_Global_CreateDictionaryItems @IntezmenyId = @intezmenyId, @TanevId = @tanevId

	FETCH NEXT FROM intezmenytanevekCursor INTO @intezmenyId, @tanevId
END  

CLOSE intezmenytanevekCursor  
DEALLOCATE intezmenytanevekCursor

UPDATE T_DICTIONARYITEMBASE
SET C_VALUE = 5
WHERE ID = 1505
	AND C_TYPE = N'OsztalyzatTipus'

UPDATE T_DICTIONARYITEMBASE
SET C_VALUE = 4
WHERE ID = 1504
	AND C_TYPE = N'OsztalyzatTipus'

UPDATE T_DICTIONARYITEMBASE
SET C_VALUE = 3
WHERE ID = 1503
	AND C_TYPE = N'OsztalyzatTipus'

UPDATE T_DICTIONARYITEMBASE
SET C_VALUE = 2
WHERE ID = 1502
	AND C_TYPE = N'OsztalyzatTipus'

UPDATE T_DICTIONARYITEMBASE
SET C_VALUE = 1
WHERE ID = 1501
	AND C_TYPE = N'OsztalyzatTipus'