﻿UPDATE DIB SET DIB.C_DICTIONARYTYPEID = dt.ID
FROM T_DICTIONARYITEMBASE DIB
INNER JOIN T_DICTIONARYTYPE dt ON dt.C_CODENAME = DIB.C_TYPE AND dt.C_TANEVID = DIB.C_TANEVID
WHERE DIB.C_DICTIONARYTYPEID <> dt.ID