﻿
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
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, 8612, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 200 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8612;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8612, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 200 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8612;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8612, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 200 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8612;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8612, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 200 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8612;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8613, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 210 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8613;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8613, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 210 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8613;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8613, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 210 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8613;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8613, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 166 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 210 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8613;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7399, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 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 
    WHERE DIB.ID = 7399;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7399, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 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 
    WHERE DIB.ID = 7399;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7399, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 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 
    WHERE DIB.ID = 7399;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7399, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 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 
    WHERE DIB.ID = 7399;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7400, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 10 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7400;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7400, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 10 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7400;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7400, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 10 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7400;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7400, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 10 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7400;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7401, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 20 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7401;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7401, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 20 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7401;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7401, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 20 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7401;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7401, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 20 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7401;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7402, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 30 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7402;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7402, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 30 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7402;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7402, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 30 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7402;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7402, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 30 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7402;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7403, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 40 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7403;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7403, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 40 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7403;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7403, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 40 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7403;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7403, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 40 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7403;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7404, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 50 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7404;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7404, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 50 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7404;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7404, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 50 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7404;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7404, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 50 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7404;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7405, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 60 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7405;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7405, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 60 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7405;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7405, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 60 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7405;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7405, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 60 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7405;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7406, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 130 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7406;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7406, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 130 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7406;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7406, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 130 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7406;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7406, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 130 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7406;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7407, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 140 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7407;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7407, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 140 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7407;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7407, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 140 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7407;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7407, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 140 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7407;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7408, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 150 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7408;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7408, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 150 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7408;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7408, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 150 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7408;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7408, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 150 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7408;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7409, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 160 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7409;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7409, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 160 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7409;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7409, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 160 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7409;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7409, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 160 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7409;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7410, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 170 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7410;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7410, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 170 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7410;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7410, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 170 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7410;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7410, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 170 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7410;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7411, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 180 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7411;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7411, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 180 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7411;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7411, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 180 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7411;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7411, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 180 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7411;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7412, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 190 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7412;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7412, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 190 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7412;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7412, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 190 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7412;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7412, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 190 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7412;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7413, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 200 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7413;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7413, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 200 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7413;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7413, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 200 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7413;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7413, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 200 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7413;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7414, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 210 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7414;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7414, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 210 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7414;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7414, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 210 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7414;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7414, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 210 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7414;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7415, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 220 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7415;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7415, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 220 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7415;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7415, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 220 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7415;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7415, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 220 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7415;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7416, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 230 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7416;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7416, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 230 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7416;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7416, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 230 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7416;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7416, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 230 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7416;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7417, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 240 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7417;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7417, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 240 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7417;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7417, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 240 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7417;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7417, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 240 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7417;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7418, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 250 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7418;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7418, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 250 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7418;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7418, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 250 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7418;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7418, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 250 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7418;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7419, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 260 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7419;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7419, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 260 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7419;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7419, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 260 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7419;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7419, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 260 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7419;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7420, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 270 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7420;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7420, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 270 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7420;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7420, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 270 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7420;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7420, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 270 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7420;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7561, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 280 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7561;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7561, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 280 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7561;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7561, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 280 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7561;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7561, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 280 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7561;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7562, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 290 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7562;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7562, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 290 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7562;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7562, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 290 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7562;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7562, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 290 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7562;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7674, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 300 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7674;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7674, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 300 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7674;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7674, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 300 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7674;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7674, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 300 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7674;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7810, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 310 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7810;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7810, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 310 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7810;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7810, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 310 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7810;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7810, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 310 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7810;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7811, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 320 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7811;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7811, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 320 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7811;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7811, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 320 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7811;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7811, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 320 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7811;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7812, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 330 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7812;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7812, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 330 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7812;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7812, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 330 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7812;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7812, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 330 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7812;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7813, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 340 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7813;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7813, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 340 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7813;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7813, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 340 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7813;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7813, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 340 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7813;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7814, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 350 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7814;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7814, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 350 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7814;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7814, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 350 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7814;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 7814, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 350 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 7814;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8620, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 360 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8620;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8620, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 360 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8620;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8620, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 360 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8620;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8620, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 360 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8620;
  END IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8621, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 370 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8621;
  END IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8621, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 370 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8621;
  END IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8621, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 370 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8621;
  END IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
  INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE) 
  SELECT DIB.ID, 8621, DIB.C_TANEVID, DIB.C_NAME, DIB.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
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET 
    DIB.TOROLT = 'T' 
  FROM T_DICTIONARYITEMBASE DIB INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.C_DICTIONARYTYPEID = 130 AND DIB.C_NAME = N'' AND DIB.TOROLT = 'F' 
  UPDATE DIB SET DIB.TOROLT = 'F'     ,DIB.C_ORDER = 370 
  FROM T_DICTIONARYITEMBASE DIB 
  INNER JOIN T_TANEV t ON t.ID = DIB.C_TANEVID AND t.TOROLT = 'F' AND t.C_SORSZAM >= @TanevSorszam 
    WHERE DIB.ID = 8621;
  END;
 DISABLE TRIGGER ALL ON T_DICTIONARYITEMBASE;  
 EXEC [dev].[uspCreateDictionaryItems] NULL, NULL; 
 ENABLE TRIGGER ALL ON T_DICTIONARYITEMBASE;  
 EXEC [dev].uspSwitchDictionaryItemBaseFromTmp;  