if exists(select * from sys.indexes i where i.[object_id] = object_id('EHR.T_EHR_RUS_BR9AP1S2QB', 'U') and i.name = 'IX_EHR_RUS_BR9AP1S2QB_CodeEHR')
begin
	drop index IX_EHR_RUS_BR9AP1S2QB_CodeEHR on EHR.T_EHR_RUS_BR9AP1S2QB;
end
CREATE INDEX IX_EHR_RUS_BR9AP1S2QB_CodeEHR ON [EHR].[T_EHR_RUS_BR9AP1S2QB] ([CodeEHR])  WITH (FILLFACTOR=90, SORT_IN_TEMPDB=ON)
GO

if exists(select * from sys.indexes i where i.[object_id] = object_id('EHR.T_EHR_RUS_MDR308', 'U') and i.name = 'IX_T_EHR_RUS_MDR308_oid')
begin
	DROP INDEX IX_T_EHR_RUS_MDR308_oid ON [EHR].[T_EHR_RUS_MDR308]
end
CREATE INDEX IX_T_EHR_RUS_MDR308_oid ON [EHR].[T_EHR_RUS_MDR308] ([oid]) INCLUDE([nameShort]) WITH (FILLFACTOR=90, SORT_IN_TEMPDB=ON)
GO

if exists(select * from sys.indexes i where i.[object_id] = object_id('EHR.T_EHR_RUS_MKB308', 'U') and i.name = 'IX_T_EHR_RUS_MKB308_MKB_CODE')
begin
	DROP INDEX IX_T_EHR_RUS_MKB308_MKB_CODE ON [EHR].T_EHR_RUS_MKB308
end
CREATE INDEX IX_T_EHR_RUS_MKB308_MKB_CODE ON [EHR].T_EHR_RUS_MKB308 ([MKB_CODE]) INCLUDE([REC_CODE],[ADDL_CODE]) WITH (FILLFACTOR=90, SORT_IN_TEMPDB=ON)
GO

if exists(select * from sys.indexes i where i.[object_id] = object_id('EHR.T_EHR_RUS_BR9AP1S2QB', 'U') and i.name = 'IX_T_EHR_RUS_BR9AP1S2QB_mo_oid')
begin
	DROP INDEX IX_T_EHR_RUS_BR9AP1S2QB_mo_oid ON [EHR].T_EHR_RUS_BR9AP1S2QB
end
CREATE INDEX IX_T_EHR_RUS_BR9AP1S2QB_mo_oid ON [EHR].T_EHR_RUS_BR9AP1S2QB ([mo_oid]) WITH (FILLFACTOR=90, SORT_IN_TEMPDB=ON)
GO
