﻿ DROP TABLE IF EXISTS tmpForSwitchDictionaryItemBase CREATE TABLE tmpForSwitchDictionaryItemBase(RegiID int, UjID int, TanevID int, C_NAME nvarchar(500), C_TYPE nvarchar(64))
 ----------------   B+ tagozat   -----------------
INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
SELECT 7667, 7666, 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'AMITagozat' AND DIB.ID = 7667 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'AMITagozat' AND DIB.ID = 7667 
