

if exists (select * from sys.indexes i where i.object_id = object_id('AKUZ.T_ENTRY_BASE', 'U') and i.name = 'IX_ENTRY_BASE_AmbulanceEvent')
	DROP INDEX IX_ENTRY_BASE_AmbulanceEvent ON AKUZ.T_ENTRY_BASE;
go
CREATE NONCLUSTERED INDEX [IX_ENTRY_BASE_AmbulanceEvent] ON [AKUZ].[T_ENTRY_BASE] ([AmbulanceEvent]) WITH (FILLFACTOR=100, SORT_IN_TEMPDB=ON, MAXDOP = 0);
go
if exists (select* from sys.indexes i where i.[object_id] = object_id('AKUZ.T_PATIENT_FIELD_EDIT_REASON', 'U') and i.name = 'IX_PATIENT_FIELD_EDIT_REASON_EventBase')
	drop index IX_PATIENT_FIELD_EDIT_REASON_EventBase ON AKUZ.T_PATIENT_FIELD_EDIT_REASON
go
    CREATE INDEX [IX_PATIENT_FIELD_EDIT_REASON_EventBase] ON [AKUZ].[T_PATIENT_FIELD_EDIT_REASON] ([EventBase])  WITH (FILLFACTOR=100, SORT_IN_TEMPDB=ON, MAXDOP = 0);
GO
if exists ( select * from sys.indexes i where i.object_id = object_id('AKUZ.T_VISIT', 'U') and i.name = 'IX_VISIT_AmbulanceEvent_OutcomeRecord')
		DROP INDEX IX_VISIT_AmbulanceEvent_OutcomeRecord ON [AKUZ].[T_VISIT];
go
CREATE INDEX [IX_VISIT_AmbulanceEvent_OutcomeRecord] ON [AKUZ].[T_VISIT] ([AmbulanceEvent], [OutcomeRecord])  WITH (FILLFACTOR=100,SORT_IN_TEMPDB=ON, MAXDOP = 0);