﻿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  

	UPDATE T_RENDSZERBEALLITAS 
	SET C_ERTEK =  '{"Id":"Default_Feladat_Kategoria","Options":[{"Selected":true,"Text":"Minden","Value":"-1"},{"Selected":false,"Text":"Alapképzés","Value":"7553"},{"Selected":false,"Text":"Ami","Value":"7555"},{"Selected":false,"Text":"Felnőttképzés","Value":"7554"},{"Selected":false,"Text":"Kollégium","Value":"7556"}]}'
	   ,C_ALAPERTEK = '{"Id":"Default_Feladat_Kategoria","Options":[{"Selected":true,"Text":"Minden","Value":"-1"},{"Selected":false,"Text":"Alapképzés","Value":"7553"},{"Selected":false,"Text":"Ami","Value":"7555"},{"Selected":false,"Text":"Felnőttképzés","Value":"7554"},{"Selected":false,"Text":"Kollégium","Value":"7556"}]}'
	WHERE C_BEALLITASTIPUS = 7565 AND C_INTEZMENYID = @intezmenyId AND C_TANEVID = @tanevId AND TOROLT = 'F'

	FETCH NEXT FROM intezmenytanevekCursor INTO @intezmenyId, @tanevId
END  

CLOSE intezmenytanevekCursor  
DEALLOCATE intezmenytanevekCursor

