﻿
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), @LastTanevSorszam int 
SET @LastTanevSorszam  = (SELECT MAX(C_SORSZAM) FROM T_TANEV WHERE TOROLT = 'F' AND (C_KOVETKEZO = 'T' OR C_AKTIV = 'T'))
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 
    -----  8736 ----- közismereti tantárgyat oktató középiskol -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8736, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató középiskol' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató középiskol' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8736 ----- közismereti tantárgyat oktató középiskol -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8736, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató középiskol' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató középiskol' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8736 ----- közismereti tantárgyat oktató középiskol -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8736, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató középiskol' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató középiskol' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8736 ----- közismereti tantárgyat oktató középiskol -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8736, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató középiskol' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató középiskol' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8737 ----- közismereti tantárgyat oktató szakgimnáziumi tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8737, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató szakgimnáziumi tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató szakgimnáziumi tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8737 ----- közismereti tantárgyat oktató szakgimnáziumi tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8737, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató szakgimnáziumi tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató szakgimnáziumi tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8737 ----- közismereti tantárgyat oktató szakgimnáziumi tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8737, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató szakgimnáziumi tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató szakgimnáziumi tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8737 ----- közismereti tantárgyat oktató szakgimnáziumi tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8737, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató szakgimnáziumi tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató szakgimnáziumi tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8738 ----- közismereti tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8738, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8738 ----- közismereti tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8738, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8738 ----- közismereti tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8738, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8738 ----- közismereti tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8738, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'közismereti tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8739 ----- művészeti szakmai tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8739, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'művészeti szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'művészeti szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8739 ----- művészeti szakmai tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8739, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'művészeti szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'művészeti szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8739 ----- művészeti szakmai tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8739, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'művészeti szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'művészeti szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8739 ----- művészeti szakmai tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8739, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'művészeti szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'művészeti szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8740 ----- szakmai tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8740, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8740 ----- szakmai tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8740, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8740 ----- szakmai tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8740, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8740 ----- szakmai tantárgyat oktató tanár -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8740, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 12 AND DIB.C_NAME = N'szakmai tantárgyat oktató tanár' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8741 ----- moldáv -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8741, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'moldáv' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'moldáv' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8741 ----- moldáv -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8741, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'moldáv' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'moldáv' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8741 ----- moldáv -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8741, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'moldáv' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'moldáv' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8741 ----- moldáv -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8741, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'moldáv' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'moldáv' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8742 ----- Montenegró -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8742, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Montenegró' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Montenegró' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8742 ----- Montenegró -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8742, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Montenegró' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Montenegró' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8742 ----- Montenegró -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8742, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Montenegró' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Montenegró' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8742 ----- Montenegró -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8742, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Montenegró' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Montenegró' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8743 ----- Palesztinai -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8743, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Palesztinai' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Palesztinai' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8743 ----- Palesztinai -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8743, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Palesztinai' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Palesztinai' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8743 ----- Palesztinai -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8743, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Palesztinai' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Palesztinai' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8743 ----- Palesztinai -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8743, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Palesztinai' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Palesztinai' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8744 ----- San Marino-i -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8744, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'San Marino-i' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'San Marino-i' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8744 ----- San Marino-i -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8744, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'San Marino-i' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'San Marino-i' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8744 ----- San Marino-i -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8744, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'San Marino-i' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'San Marino-i' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8744 ----- San Marino-i -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8744, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'San Marino-i' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'San Marino-i' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8745 ----- Szerb-montenegrói -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8745, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Szerb-montenegrói' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Szerb-montenegrói' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8745 ----- Szerb-montenegrói -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8745, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Szerb-montenegrói' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Szerb-montenegrói' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8745 ----- Szerb-montenegrói -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8745, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Szerb-montenegrói' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Szerb-montenegrói' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8745 ----- Szerb-montenegrói -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8745, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Szerb-montenegrói' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 9 AND DIB.C_NAME = N'Szerb-montenegrói' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8746 ----- Cseh Köztársaság -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8746, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Cseh Köztársaság' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Cseh Köztársaság' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8746 ----- Cseh Köztársaság -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8746, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Cseh Köztársaság' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Cseh Köztársaság' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8746 ----- Cseh Köztársaság -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8746, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Cseh Köztársaság' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Cseh Köztársaság' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8746 ----- Cseh Köztársaság -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8746, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Cseh Köztársaság' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Cseh Köztársaság' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8747 ----- Egyesült Nemzetek Szervezete -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8747, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Egyesült Nemzetek Szervezete' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Egyesült Nemzetek Szervezete' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8747 ----- Egyesült Nemzetek Szervezete -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8747, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Egyesült Nemzetek Szervezete' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Egyesült Nemzetek Szervezete' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8747 ----- Egyesült Nemzetek Szervezete -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8747, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Egyesült Nemzetek Szervezete' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Egyesült Nemzetek Szervezete' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8747 ----- Egyesült Nemzetek Szervezete -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8747, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Egyesült Nemzetek Szervezete' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Egyesült Nemzetek Szervezete' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8748 ----- Európai Unió -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8748, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Európai Unió' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Európai Unió' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8748 ----- Európai Unió -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8748, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Európai Unió' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Európai Unió' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8748 ----- Európai Unió -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8748, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Európai Unió' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Európai Unió' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8748 ----- Európai Unió -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8748, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Európai Unió' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Európai Unió' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8749 ----- Moldávia -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8749, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Moldávia' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Moldávia' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8749 ----- Moldávia -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8749, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Moldávia' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Moldávia' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8749 ----- Moldávia -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8749, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Moldávia' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Moldávia' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8749 ----- Moldávia -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8749, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Moldávia' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'Moldávia' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'KK'
  BEGIN 
    -----  8750 ----- NATO -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8750, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'NATO' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'NATO' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'NSZFH'
  BEGIN 
    -----  8750 ----- NATO -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8750, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'NATO' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'NATO' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'HOI'
  BEGIN 
    -----  8750 ----- NATO -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8750, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'NATO' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'NATO' AND DIB.TOROLT = 'F' 
END 

IF @TEMP_EnvironmentName = 'AZURE'
  BEGIN 
    -----  8750 ----- NATO -----
    INSERT INTO tmpForSwitchDictionaryItemBase(RegiID, UjID, TanevID, C_NAME, C_TYPE)
    SELECT DIB.ID, 8750, DIB.C_TANEVID, DIB.C_NAME, DIB.C_TYPE
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'NATO' AND DIB.TOROLT = 'F' 
    UPDATE DIB SET 
    DIB.TOROLT = 'T' 
    FROM T_DICTIONARYITEMBASE DIB 
      WHERE DIB.C_DICTIONARYTYPEID = 15 AND DIB.C_NAME = N'NATO' AND DIB.TOROLT = 'F' 
END 
;
 DISABLE TRIGGER ALL ON T_DICTIONARYITEMBASE;  
 EXEC [dev].[uspCreateDictionaryItems] NULL, NULL; 
 ENABLE TRIGGER ALL ON T_DICTIONARYITEMBASE;  
 EXEC [dev].uspSwitchDictionaryItemBaseFromTmp;  
