﻿UPDATE T_TANTARGY
SET C_TARGYKATEGORIA = 7688
WHERE C_TARGYKATEGORIA = 7779
GO

DELETE FROM T_TARGYKATEGORIATIPUS
WHERE ID = 7779
GO

DELETE FROM T_DICTIONARYITEMBASE
WHERE ID = 7779
GO


UPDATE tantargy
SET C_TARGYKATEGORIA = 7688
FROM T_TANTARGY tantargy
INNER JOIN T_DICTIONARYITEMBASE dic on dic.ID = tantargy.C_TARGYKATEGORIA AND tantargy.C_TANEVID = dic.C_TANEVID
WHERE dic.C_TYPE = 'TargyKategoriaTipus'
  AND dic.C_NAME = 'Szorgalom'
  AND dic.ID > 100000
GO

DELETE FROM targykat
FROM T_TARGYKATEGORIATIPUS targykat
INNER JOIN T_DICTIONARYITEMBASE dic on dic.ID = targykat.ID AND targykat.C_ALTANEVID = dic.C_TANEVID
WHERE dic.C_TYPE = 'TargyKategoriaTipus'
  AND dic.C_NAME = 'Szorgalom'
  AND dic.ID > 100000
GO

DELETE FROM T_DICTIONARYITEMBASE
WHERE C_TYPE = 'TargyKategoriaTipus'
  AND C_NAME = 'Szorgalom'
  AND ID > 100000
GO


UPDATE T_DICTIONARYITEMBASE
SET C_NAME = 'Szorgalom'
   ,C_NAME_1 = 'Szorgalom'
WHERE ID = 7688
GO
