﻿ALTER TABLE T_DICTIONARYITEMBASE NOCHECK CONSTRAINT all
ALTER TABLE T_EVFOLYAMTIPUS NOCHECK CONSTRAINT all
ALTER TABLE T_EVFOLYAMTIPUS_OKTATASINEVELE NOCHECK CONSTRAINT all
ALTER TABLE T_KIZAROCSOPORT NOCHECK CONSTRAINT all
ALTER TABLE T_ORATERV NOCHECK CONSTRAINT all
ALTER TABLE T_OSZTALYCSOPORT NOCHECK CONSTRAINT all
ALTER TABLE T_TANTERV NOCHECK CONSTRAINT all

UPDATE T_DICTIONARYITEMBASE
SET TOROLT = 'T'
WHERE C_TANEVID IN (
    SELECT ID
    FROM T_TANEV
    WHERE C_NEV = '2017/2018')
  AND ID IN (1327, 1328, 1329)

UPDATE T_EVFOLYAMTIPUS
SET TOROLT = 'T'
WHERE C_ALTANEVID IN (
    SELECT ID
    FROM T_TANEV
    WHERE C_NEV = '2017/2018')
  AND ID IN (1327, 1328, 1329)

DELETE FROM T_EVFOLYAMTIPUS_OKTATASINEVELE
WHERE C_TANEVID IN (
    SELECT ID
    FROM T_TANEV
    WHERE C_NEV = '2017/2018')
  AND C_EVFOLYAMTIPUSID IN (1327, 1328, 1329)

UPDATE T_KIZAROCSOPORT
SET C_EVFOLYAM = 1296
WHERE C_TANEVID IN (
    SELECT ID
    FROM T_TANEV
    WHERE C_NEV = '2017/2018')
  AND C_EVFOLYAM IN (1327, 1328, 1329)

UPDATE T_ORATERV
SET C_EVFOLYAM = 1296
WHERE C_TANEVID IN (
    SELECT ID
    FROM T_TANEV
    WHERE C_NEV = '2017/2018')
  AND C_EVFOLYAM IN (1327, 1328, 1329)

UPDATE T_OSZTALYCSOPORT
SET C_EVFOLYAMTIPUSA = 1296
WHERE C_TANEVID IN (
    SELECT ID
    FROM T_TANEV
    WHERE C_NEV = '2017/2018')
  AND C_EVFOLYAMTIPUSA IN (1327, 1328, 1329)

UPDATE T_TANTERV
SET C_EVFOLYAMIG = 1296
WHERE C_TANEVID IN (
    SELECT ID
    FROM T_TANEV
    WHERE C_NEV = '2017/2018')
  AND C_EVFOLYAMIG IN (1327, 1328, 1329)

UPDATE T_TANTERV
SET C_EVFOLYAMTOL = 1296
WHERE C_TANEVID IN (
    SELECT ID
    FROM T_TANEV
    WHERE C_NEV = '2017/2018')
  AND C_EVFOLYAMTOL IN (1327, 1328, 1329)

ALTER TABLE T_DICTIONARYITEMBASE WITH CHECK CHECK CONSTRAINT all
ALTER TABLE T_EVFOLYAMTIPUS WITH CHECK CHECK CONSTRAINT all
ALTER TABLE T_EVFOLYAMTIPUS_OKTATASINEVELE WITH CHECK CHECK CONSTRAINT all
ALTER TABLE T_KIZAROCSOPORT WITH CHECK CHECK CONSTRAINT all
ALTER TABLE T_ORATERV WITH CHECK CHECK CONSTRAINT all
ALTER TABLE T_OSZTALYCSOPORT WITH CHECK CHECK CONSTRAINT all
ALTER TABLE T_TANTERV WITH CHECK CHECK CONSTRAINT all