﻿IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'NCI_TanitasiOra_IntezmenyId_TanevId_TeremId') BEGIN
  CREATE INDEX NCI_TanitasiOra_IntezmenyId_TanevId_TeremId 
  ON T_TANITASIORA (C_INTEZMENYID, C_TANEVID, C_TEREMID) 
  WHERE TOROLT = 'F'
  WITH (FILLFACTOR = 80)
END
GO

DROP INDEX IF EXISTS NCI_NaptariNap_IntezmenyId_TanevId_NapDatuma_OrarendiNap ON T_NAPTARINAP
GO
CREATE INDEX NCI_NaptariNap_IntezmenyId_TanevId_NapDatuma_OrarendiNap
ON T_NAPTARINAP (C_INTEZMENYID, C_TANEVID, C_NAPDATUMA, C_ORARENDINAP)
INCLUDE (C_HETNAPJA, C_HETIREND, C_HETSORSZAMA)
WHERE TOROLT = 'F'
WITH (FILLFACTOR = 80)
GO

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'NCI_TanitasiOra_TantargyId_OsztalycsoportId_OraKezdete_IntezmenyId_TanevId') BEGIN
  CREATE INDEX NCI_TanitasiOra_TantargyId_OsztalycsoportId_OraKezdete_IntezmenyId_TanevId 
  ON T_TANITASIORA (C_TANTARGYID, C_OSZTALYCSOPORTID, C_ORAKEZDETE, C_INTEZMENYID, C_TANEVID)     
  WHERE TOROLT = 'F'
  WITH (FILLFACTOR = 80)
END
GO
