﻿IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = 'NCI_Felhasznalo_ElozotanevirekordId') BEGIN
	CREATE INDEX NCI_Felhasznalo_ElozotanevirekordId
	  ON T_FELHASZNALO (ELOZOTANEVIREKORDID) 
	  INCLUDE(C_INTEZMENYID) 
	  WHERE TOROLT = 'F'
	WITH (FILLFACTOR = 80)
END
GO

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = 'NCI_Terem_ElozotanevirekordId_IntezmenyId') BEGIN
	CREATE INDEX NCI_Terem_ElozotanevirekordId_IntezmenyId
	  ON T_TEREM (ELOZOTANEVIREKORDID,C_INTEZMENYID) 
	  INCLUDE (C_JELLEG,C_NEV,C_TEREMFELELOSID,C_MUKODESIHELYID,SERIAL,TOROLT)
	WITH (FILLFACTOR = 80)
END
GO

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = 'NCI_Mukodesihely_ElozotanevirekordId') BEGIN
	CREATE INDEX NCI_Mukodesihely_ElozotanevirekordId
	  ON T_MUKODESIHELY (ELOZOTANEVIREKORDID) 
	  INCLUDE (C_INTEZMENYID)
    WHERE TOROLT='F'
	WITH (FILLFACTOR = 80)
END
GO