﻿
DROP TABLE IF EXISTS tmpForSwitchDictionaryItemBase 
CREATE TABLE tmpForSwitchDictionaryItemBase(RegiID int, UjID int, TanevID int, C_NAME nvarchar(500), C_TYPE nvarchar(64))
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 = '2020/2021' 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) 
  SELECT DIB.ID, 7865, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/12.' 
  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 = 7865;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7865, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/12.' 
  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 = 7865;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7865, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/12.' 
  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 = 7865;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7865, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/12.' 
  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 = 7865;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1301, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'Előképző 1.' 
  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 = 1301;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1301, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'Előképző 1.' 
  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 = 1301;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1301, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'Előképző 1.' 
  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 = 1301;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1301, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'Előképző 1.' 
  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 = 1301;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1302, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'Előképző 2.' 
  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 = 1302;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1302, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'Előképző 2.' 
  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 = 1302;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1302, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'Előképző 2.' 
  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 = 1302;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1302, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'Előképző 2.' 
  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 = 1302;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1303, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1.' 
  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 = 1303;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1303, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1.' 
  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 = 1303;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1303, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1.' 
  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 = 1303;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1303, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1.' 
  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 = 1303;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1304, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2.' 
  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 = 1304;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1304, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2.' 
  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 = 1304;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1304, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2.' 
  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 = 1304;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1304, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2.' 
  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 = 1304;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1305, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3.' 
  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 = 1305;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1305, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3.' 
  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 = 1305;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1305, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3.' 
  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 = 1305;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1305, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3.' 
  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 = 1305;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1306, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4.' 
  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 = 1306;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1306, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4.' 
  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 = 1306;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1306, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4.' 
  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 = 1306;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1306, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4.' 
  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 = 1306;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1307, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5.' 
  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 = 1307;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1307, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5.' 
  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 = 1307;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1307, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5.' 
  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 = 1307;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1307, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5.' 
  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 = 1307;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1308, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'6.' 
  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 = 1308;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1308, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'6.' 
  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 = 1308;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1308, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'6.' 
  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 = 1308;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1308, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'6.' 
  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 = 1308;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'7.' 
  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 = 1309;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'7.' 
  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 = 1309;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'7.' 
  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 = 1309;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'7.' 
  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 = 1309;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'8.' 
  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 = 1310;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'8.' 
  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 = 1310;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'8.' 
  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 = 1310;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'8.' 
  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 = 1310;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7109, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'7.' 
  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 = 7109;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7109, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'7.' 
  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 = 7109;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7109, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'7.' 
  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 = 7109;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7109, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'7.' 
  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 = 7109;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7110, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'8.' 
  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 = 7110;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7110, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'8.' 
  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 = 7110;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7110, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'8.' 
  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 = 7110;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7110, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'8.' 
  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 = 7110;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 1311;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 1311;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 1311;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 1311;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7111, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7111;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7111, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7111;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7111, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7111;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7111, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7111;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7112, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7112;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7112, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7112;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7112, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7112;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7112, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7112;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7113, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7113;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7113, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7113;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7113, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7113;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7113, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7113;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7114, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7114;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7114, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7114;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7114, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7114;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7114, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7114;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 1312;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 1312;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 1312;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 1312;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7115, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7115;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7115, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7115;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7115, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7115;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7115, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7115;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7116, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7116;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7116, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7116;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7116, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7116;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7116, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7116;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7117, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7117;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7117, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7117;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7117, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7117;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7117, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7117;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7118, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7118;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7118, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7118;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7118, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7118;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7118, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'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 = 7118;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 1313;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 1313;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 1313;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 1313;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7119, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7119;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7119, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7119;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7119, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7119;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7119, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7119;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7120, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7120;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7120, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7120;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7120, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7120;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7120, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7120;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7121, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7121;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7121, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7121;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7121, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7121;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7121, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7121;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7122, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7122;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7122, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7122;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7122, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7122;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7122, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'11.' 
  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 = 7122;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 1314;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 1314;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 1314;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 1314;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7123, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7123;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7123, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7123;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7123, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7123;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7123, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7123;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7124, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7124;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7124, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7124;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7124, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7124;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7124, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7124;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7125, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7125;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7125, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7125;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7125, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7125;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7125, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7125;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7126, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7126;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7126, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7126;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7126, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7126;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7126, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'12.' 
  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 = 7126;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1315, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'13.' 
  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 = 1315;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1315, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'13.' 
  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 = 1315;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1315, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'13.' 
  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 = 1315;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1315, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'13.' 
  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 = 1315;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7127, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7127;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7127, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7127;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7127, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7127;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7127, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7127;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7128, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7128;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7128, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7128;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7128, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7128;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7128, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'9.' 
  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 = 7128;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1324, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/8.' 
  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 = 1324;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1324, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/8.' 
  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 = 1324;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1324, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/8.' 
  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 = 1324;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1324, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/8.' 
  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 = 1324;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1316, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/9.' 
  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 = 1316;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1316, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/9.' 
  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 = 1316;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1316, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/9.' 
  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 = 1316;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1316, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/9.' 
  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 = 1316;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7862, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/9.' 
  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 = 7862;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7862, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/9.' 
  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 = 7862;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7862, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/9.' 
  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 = 7862;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7862, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/9.' 
  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 = 7862;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1323, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/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 = 1323;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1323, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/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 = 1323;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1323, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/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 = 1323;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1323, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/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 = 1323;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7863, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/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 = 7863;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7863, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/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 = 7863;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7863, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/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 = 7863;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7863, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/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 = 7863;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1325, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/11.' 
  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 = 1325;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1325, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/11.' 
  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 = 1325;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1325, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/11.' 
  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 = 1325;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1325, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/11.' 
  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 = 1325;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7864, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/11.' 
  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 = 7864;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7864, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/11.' 
  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 = 7864;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7864, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/11.' 
  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 = 7864;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7864, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/11.' 
  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 = 7864;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6520, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/12.' 
  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 = 6520;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6520, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/12.' 
  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 = 6520;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6520, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/12.' 
  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 = 6520;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6520, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/12.' 
  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 = 6520;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6469, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5/13.' 
  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 = 6469;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6469, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5/13.' 
  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 = 6469;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6469, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5/13.' 
  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 = 6469;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6469, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5/13.' 
  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 = 6469;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7910, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5/13.' 
  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 = 7910;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7910, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5/13.' 
  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 = 7910;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7910, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5/13.' 
  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 = 7910;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7910, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'5/13.' 
  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 = 7910;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1317, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/11.' 
  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 = 1317;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1317, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/11.' 
  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 = 1317;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1317, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/11.' 
  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 = 1317;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1317, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/11.' 
  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 = 1317;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1318, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/12.' 
  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 = 1318;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1318, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/12.' 
  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 = 1318;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1318, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/12.' 
  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 = 1318;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1318, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/12.' 
  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 = 1318;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1322, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/13.' 
  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 = 1322;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1322, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/13.' 
  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 = 1322;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1322, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/13.' 
  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 = 1322;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1322, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/13.' 
  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 = 1322;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1319, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/13.' 
  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 = 1319;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1319, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/13.' 
  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 = 1319;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1319, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/13.' 
  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 = 1319;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1319, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/13.' 
  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 = 1319;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7883, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/13.' 
  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 = 7883;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7883, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/13.' 
  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 = 7883;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7883, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/13.' 
  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 = 7883;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7883, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/13.' 
  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 = 7883;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1320, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/14.' 
  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 = 1320;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1320, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/14.' 
  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 = 1320;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1320, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/14.' 
  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 = 1320;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1320, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/14.' 
  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 = 1320;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7884, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/14.' 
  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 = 7884;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7884, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/14.' 
  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 = 7884;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7884, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/14.' 
  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 = 7884;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7884, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'2/14.' 
  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 = 7884;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8395, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/15.' 
  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 = 8395;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8395, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/15.' 
  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 = 8395;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8395, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/15.' 
  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 = 8395;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8395, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/15.' 
  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 = 8395;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1321, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/15.' 
  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 = 1321;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1321, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/15.' 
  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 = 1321;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1321, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/15.' 
  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 = 1321;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1321, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'3/15.' 
  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 = 1321;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6468, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/16.' 
  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 = 6468;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6468, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/16.' 
  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 = 6468;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6468, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/16.' 
  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 = 6468;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 6468, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'4/16.' 
  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 = 6468;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1326, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/12.' 
  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 = 1326;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1326, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/12.' 
  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 = 1326;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1326, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/12.' 
  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 = 1326;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1326, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/12.' 
  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 = 1326;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7901, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/12.' 
  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 = 7901;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7901, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/12.' 
  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 = 7901;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7901, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/12.' 
  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 = 7901;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7901, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/12.' 
  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 = 7901;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1337, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/15.' 
  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 = 1337;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1337, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/15.' 
  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 = 1337;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1337, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/15.' 
  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 = 1337;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 1337, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/15.' 
  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 = 1337;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7911, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/15.' 
  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 = 7911;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7911, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/15.' 
  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 = 7911;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7911, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/15.' 
  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 = 7911;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7911, 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_SORSZAM >= @TanevSorszam AND t.C_SORSZAM <= @LastTanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 37 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 = 37 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_NAME_1 = N'1/15.' 
  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 = 7911;
  END;
 DISABLE TRIGGER ALL ON T_DICTIONARYITEMBASE;  
 EXEC [dev].[uspCreateDictionaryItems] NULL, NULL; 
 ENABLE TRIGGER ALL ON T_DICTIONARYITEMBASE;  
 EXEC [dev].uspSwitchDictionaryItemBaseFromTmp;  
