﻿IF (@@SERVERNAME LIKE '%KAKH%')
	BEGIN
		SELECT '----- KK specifikus scriptek kezdete -----'
 DROP TABLE IF EXISTS tmpForSwitchDictionaryItemBase CREATE TABLE tmpForSwitchDictionaryItemBase(RegiID int, UjID int, TanevID int, C_NAME nvarchar(500), C_TYPE nvarchar(64))
 ----------------   7 gimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7109, 1309, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7109 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7109 
----------------   8 gimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7110, 1310, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7110 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7110 
----------------   9 szakgimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7111, 1311, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7111 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7111 
----------------   9 gimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7112, 1311, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7112 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7112 
----------------   9 szakiskola   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7113, 1311, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7113 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7113 
----------------   9 készségfejlesztő iskola   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7114, 1311, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7114 AND DIB.TOROLT = 'F' 
UPDATE DIB SET C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7114 
----------------   10 szakgimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7115, 1312, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7115 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7115 
----------------   10 gimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7116, 1312, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7116 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7116 
----------------   10 szakiskola   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7117, 1312, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7117 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7117 
----------------   11 szakgimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7119, 1313, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7119 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7119 
----------------   11 gimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7120, 1313, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7120 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7120 
----------------   11 szakiskola   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7121, 1313, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7121 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7121 
----------------   11 készségfejlesztő iskola   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7122, 1313, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7122 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7122 
----------------   12 szakgimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7123, 1314, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7123 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7123 
----------------   12 gimnázium   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7124, 1314, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7124 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7124 
----------------   12 szakiskola   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7125, 1314, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7125 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7125 
----------------   12 készségfejlesztő iskola   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7126, 1314, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7126 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7126 
----------------   9/Ny gimnázium nyelvi előkészítő   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7127, 1332, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7127 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7127 
----------------   9/Kny gimnázium két tanítási nyelvű előkészítő   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7128, 1333, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7128 AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
C_VISIBLE = 'F' 
FROM T_DICTIONARYITEMBASE DIB 
INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_NEV = '2019/2020'
WHERE DIB.C_TYPE = N'EvfolyamTipus' AND DIB.ID = 7128 
 		SELECT '----- KK specifikus scriptek vege -----'
	END;