﻿
DROP TABLE IF EXISTS tmpForSwitchDictionaryItemBase 
CREATE TABLE tmpForSwitchDictionaryItemBase(RegiID int, UjID int, TanevID int, C_NAME nvarchar(500), C_TYPE nvarchar(64), Torolni char(1))
DECLARE @TEMP_EnvironmentName nvarchar(1000), @TanevSorszam int, @LastTanevSorszam int
SET @LastTanevSorszam  = (SELECT MAX(C_SORSZAM) FROM T_TANEV WHERE TOROLT = 'F' AND (C_KOVETKEZO = 'T' OR C_AKTIV = 'T'))
SET @TanevSorszam = ISNULL((SELECT TOP 1 C_SORSZAM FROM T_TANEV WHERE C_NEV = '2021/2022' ORDER BY C_SORSZAM),32)
SET @TEMP_EnvironmentName = (SELECT [Value] 
FROM dev.EnvironmentInfo WHERE [Key] = 'Dictionary')
IF (@TEMP_EnvironmentName IS NULL OR @TEMP_EnvironmentName NOT IN ('KK','NSZFH','HOI','AZURE'))
BEGIN  INSERT INTO T_DICTIONARYITEMBASE(C_VALUE) VALUES('Nincs Dictionary ertek a dev.EnvironmentInfo tablaban') END  -- elszall a migracio ha nincs 
 IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6868, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 100 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6868;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6868, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 100 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6868;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6868, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 100 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6868;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6868, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 100 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6868;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6862, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 90 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6862;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6862, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 90 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6862;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6862, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 90 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6862;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6862, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 90 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6862;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6861, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 80 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6861;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6861, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 80 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6861;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6861, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 80 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6861;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6861, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 80 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6861;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6856, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 140 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6856;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6856, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 140 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6856;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6856, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 140 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6856;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6856, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 140 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6856;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6866, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 60 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6866;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6866, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 60 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6866;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6866, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 60 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6866;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6866, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 60 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6866;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6865, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'Doktori fokozat PhD' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'Doktori fokozat PhD' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Doktori fokozat PhD' 
    ,DIB.C_NAME_1 = N'Doktori fokozat PhD' 
    ,DIB.C_ORDER = 50 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6865;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6865, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'Doktori fokozat PhD' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'Doktori fokozat PhD' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Doktori fokozat PhD' 
    ,DIB.C_NAME_1 = N'Doktori fokozat PhD' 
    ,DIB.C_ORDER = 50 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6865;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6865, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'Doktori fokozat PhD' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'Doktori fokozat PhD' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Doktori fokozat PhD' 
    ,DIB.C_NAME_1 = N'Doktori fokozat PhD' 
    ,DIB.C_ORDER = 50 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6865;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6865, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'Doktori fokozat PhD' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'Doktori fokozat PhD' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Doktori fokozat PhD' 
    ,DIB.C_NAME_1 = N'Doktori fokozat PhD' 
    ,DIB.C_ORDER = 50 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6865;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6860, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 10 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6860;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6860, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 10 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6860;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6860, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 10 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6860;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6860, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 10 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6860;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6858, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 110 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6858;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6858, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 110 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6858;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6858, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 110 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6858;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6858, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 110 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6858;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6859, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 70 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6859;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6859, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 70 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6859;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6859, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 70 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6859;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6859, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 70 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6859;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6857, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 130 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6857;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6857, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 130 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6857;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6857, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 130 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6857;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6857, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 130 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6857;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6962, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 120 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6962;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6962, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 120 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6962;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6962, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 120 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6962;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6962, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 120 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6962;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6867, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 150 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6867;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6867, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 150 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6867;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6867, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 150 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6867;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6867, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 150 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6867;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6869, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 40 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6869;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6869, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 40 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6869;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6869, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 40 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6869;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6869, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 40 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6869;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6864, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 30 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6864;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6864, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 30 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6864;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6864, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 30 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6864;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6864, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 30 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6864;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6863, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 20 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6863;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6863, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 20 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6863;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6863, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 20 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6863;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 6863, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 103 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 20 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 6863;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 7920, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 149 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 149 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 7920;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 7920, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 149 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 149 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 7920;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 7920, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 149 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 149 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 7920;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 7920, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 149 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 149 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 7920;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8493, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 163 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 163 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8493;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8493, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 163 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 163 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8493;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8493, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 163 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 163 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8493;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8493, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 163 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 163 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8493;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8464, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 162 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 162 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8464;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8464, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 162 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 162 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8464;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8464, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 162 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 162 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8464;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8464, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 162 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 162 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8464;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8122, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 151 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 151 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8122;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8122, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 151 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 151 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8122;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8122, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 151 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 151 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8122;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8122, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 151 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 151 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8122;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 7946, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 150 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 150 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 7946;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 7946, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 150 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 150 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 7946;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 7946, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 150 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 150 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 7946;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 7946, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 150 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 150 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 7946;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8459, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 161 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 161 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8459;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8459, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 161 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 161 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8459;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8459, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 161 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 161 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8459;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE, Torolni) 
  SELECT DIB.ID, 8459, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE, 'F' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 161 AND DIB.C_NAME = N'Na' 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 161 AND DIB.C_NAME = N'Na' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME = N'Na' 
    ,DIB.C_NAME_1 = N'Na' 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.ID = 8459;
  END;
 DISABLE TRIGGER ALL ON T_DICTIONARYITEMBASE;  
 EXEC [dev].[uspCreateDictionaryItems] NULL, NULL; 
 ENABLE TRIGGER ALL ON T_DICTIONARYITEMBASE;  
 EXEC [dev].uspSwitchDictionaryItemBaseFromTmp;  
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 9 WHERE ID = 6868;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 8 WHERE ID = 6862;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 7 WHERE ID = 6861;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 16 WHERE ID = 6856;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 2 WHERE ID = 6866;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 1 WHERE ID = 6865;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 6 WHERE ID = 6860;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 12 WHERE ID = 6858;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 10 WHERE ID = 6859;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 14 WHERE ID = 6857;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 15 WHERE ID = 6962;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 17 WHERE ID = 6867;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 5 WHERE ID = 6869;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 4 WHERE ID = 6864;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 3 WHERE ID = 6863;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 18 WHERE ID = 6855;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 11 WHERE ID = 8794;
 UPDATE T_DICTIONARYITEMBASE SET C_VALUE = 13 WHERE ID = 8795;
