﻿ DROP TABLE IF EXISTS tmpForSwitchDictionaryItemBase 
CREATE TABLE tmpForSwitchDictionaryItemBase(RegiID int, UjID int, TanevID int, C_NAME nvarchar(500), C_TYPE nvarchar(64))
----------------   Alkalmazott   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT DIB.ID, 7781, 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'SzerepkorTipus' AND DIB.C_NAME = N'Alkalmazott' AND DIB.TOROLT = 'F' 
UPDATE DIB SET 
DIB.TOROLT = 'T' 
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'SzerepkorTipus' AND DIB.C_NAME = N'Alkalmazott' AND DIB.TOROLT = 'F' 
