If INDEXPROPERTY(Object_Id('ISZL.T_SCHET_SLUCH'), 'IX_T_SCHET_SLUCH_Date1', 'IndexID') Is Not Null
BEGIN
	DROP INDEX [IX_T_SCHET_SLUCH_Date1] ON [ISZL].[T_SCHET_SLUCH]
END
CREATE NONCLUSTERED INDEX [IX_T_SCHET_SLUCH_Date1] ON [ISZL].[T_SCHET_SLUCH]
(
	[DATE_1] ASC
)
GO

If INDEXPROPERTY(Object_Id('ISZL.T_SCHET_SLUCH'), 'IX_T_SCHET_SLUCH_Date2', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_SCHET_SLUCH_Date2] ON [ISZL].[T_SCHET_SLUCH]
END
CREATE NONCLUSTERED INDEX [IX_T_SCHET_SLUCH_Date2] ON [ISZL].[T_SCHET_SLUCH]
(
	[DATE_2] ASC
)
GO

IF INDEXPROPERTY(Object_Id('iszl.T_MO_ATTACHMENT'), 'IX_T_MO_ATTACHMENT_Insured', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_MO_ATTACHMENT_Insured] ON [iszl].[T_MO_ATTACHMENT]
END
CREATE NONCLUSTERED INDEX [IX_T_MO_ATTACHMENT_Insured] ON [iszl].[T_MO_ATTACHMENT]
(
	[Insured] ASC
)
GO

IF INDEXPROPERTY(Object_Id('iszl.T_MO_ATTACHMENT'), 'IX_T_MO_ATTACHMENT_AttachDate', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_MO_ATTACHMENT_AttachDate] ON [iszl].[T_MO_ATTACHMENT]
END

CREATE NONCLUSTERED INDEX [IX_T_MO_ATTACHMENT_AttachDate] ON [iszl].[T_MO_ATTACHMENT]
(
[AttachDate] ASC
)

IF INDEXPROPERTY(Object_Id('iszl.T_MO_ATTACHMENT'), 'IX_T_MO_ATTACHMENT_Cause', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_MO_ATTACHMENT_Cause] ON [iszl].[T_MO_ATTACHMENT]
END

CREATE NONCLUSTERED INDEX [IX_T_MO_ATTACHMENT_Cause] ON [iszl].[T_MO_ATTACHMENT]
(
[Cause] ASC
)

IF INDEXPROPERTY(Object_Id('iszl.T_MO_ATTACHMENT'), 'IX_T_MO_ATTACHMENT_Mo', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_MO_ATTACHMENT_Mo] ON [iszl].[T_MO_ATTACHMENT]
END

CREATE NONCLUSTERED INDEX [IX_T_MO_ATTACHMENT_Mo] ON [iszl].[T_MO_ATTACHMENT]
(
[Mo] ASC
)

IF INDEXPROPERTY(Object_Id('iszl.T_MO_ATTACHMENT'), 'IX_T_MO_ATTACHMENT_PODR', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_MO_ATTACHMENT_PODR] ON [iszl].[T_MO_ATTACHMENT]
END

CREATE NONCLUSTERED INDEX [IX_T_MO_ATTACHMENT_PODR] ON [iszl].[T_MO_ATTACHMENT]
(
[PODR] ASC
)

IF INDEXPROPERTY(Object_Id('iszl.T_MO_ATTACHMENT'), 'IX_T_MO_ATTACHMENT_UCH', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_MO_ATTACHMENT_UCH] ON [iszl].[T_MO_ATTACHMENT]
END

CREATE NONCLUSTERED INDEX [IX_T_MO_ATTACHMENT_UCH] ON [iszl].[T_MO_ATTACHMENT]
(
[UCH] ASC
)

IF INDEXPROPERTY(Object_Id('iszl.T_MO_ATTACHMENT'), 'IX_T_MO_ATTACHMENT_Status', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_MO_ATTACHMENT_Status] ON [iszl].[T_MO_ATTACHMENT]
END

CREATE NONCLUSTERED INDEX [IX_T_MO_ATTACHMENT_Status] ON [iszl].[T_MO_ATTACHMENT]
(
[Status] ASC
)

IF INDEXPROPERTY(Object_Id('iszl.T_INSURED_CONTACT'), 'IX_T_INSURED_CONTACT_ContactType', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_INSURED_CONTACT_ContactType] ON [iszl].[T_INSURED_CONTACT]
END

CREATE NONCLUSTERED INDEX [IX_T_INSURED_CONTACT_ContactType] ON [iszl].[T_INSURED_CONTACT]
(
[ContactType] ASC
)

IF INDEXPROPERTY(Object_Id('iszl.T_INSURED_CONTACT'), 'IX_T_INSURED_CONTACT_Contact', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_INSURED_CONTACT_Contact] ON [iszl].[T_INSURED_CONTACT]
END
CREATE NONCLUSTERED INDEX [IX_T_INSURED_CONTACT_Contact] ON [iszl].[T_INSURED_CONTACT]
(
	[Contact] ASC
)
GO

IF INDEXPROPERTY(Object_Id('ISZL.T_SCHET_SLUCH'), 'IX_T_SCHET_SLUCH_DS1', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_SCHET_SLUCH_DS1] ON [ISZL].[T_SCHET_SLUCH]
END
CREATE NONCLUSTERED INDEX [IX_T_SCHET_SLUCH_DS1] ON [ISZL].[T_SCHET_SLUCH]
(
	[DS1] ASC
)
GO

IF INDEXPROPERTY(Object_Id('ISZL.T_SCHET_SLUCH'), 'IX_T_SCHET_SLUCH_SCHETSLUCHACCOMPLISHED', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_SCHET_SLUCH_SCHETSLUCHACCOMPLISHED] ON [ISZL].[T_SCHET_SLUCH]
END
CREATE NONCLUSTERED INDEX IX_T_SCHET_SLUCH_SCHETSLUCHACCOMPLISHED ON ISZL.T_SCHET_SLUCH (SchetSluchAccomplished)
GO

IF INDEXPROPERTY(Object_Id('ISZL.T_SCHET_SLUCH_ONK'), 'IX_T_SCHET_SLUCH_ONK_SCHETSLUCH', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_SCHET_SLUCH_ONK_SCHETSLUCH] ON [ISZL].[T_SCHET_SLUCH_ONK]
END
CREATE INDEX IX_T_SCHET_SLUCH_ONK_SCHETSLUCH ON ISZL.T_SCHET_SLUCH_ONK (schetsluch)
GO

IF INDEXPROPERTY(Object_Id('ISZL.T_SCHET'), 'IX_T_SCHET_SCHETFILE', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_SCHET_SCHETFILE] ON [ISZL].[T_SCHET]
END
CREATE INDEX IX_T_SCHET_SCHETFILE ON ISZL.T_SCHET (SchetFile)
GO

IF INDEXPROPERTY(Object_Id('ISZL.T_SCHET_ZAP'), 'IX_T_SCHET_ZAP_SCHET', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [IX_T_SCHET_ZAP_SCHET] ON [ISZL].[T_SCHET_ZAP]
END
CREATE INDEX IX_T_SCHET_ZAP_SCHET ON ISZL.T_SCHET_ZAP (Schet)
GO

IF INDEXPROPERTY(Object_Id('ISZL.T_SCHET_SLUCH_ACCOMPLISHED'), 'UQ_T_SCHET_SLUCH_ACCOMPLISHED_SCHETZAP', 'IndexID') Is Not Null
BEGIN
    DROP INDEX [UQ_T_SCHET_SLUCH_ACCOMPLISHED_SCHETZAP] ON [ISZL].[T_SCHET_SLUCH_ACCOMPLISHED]
END
CREATE UNIQUE INDEX UQ_T_SCHET_SLUCH_ACCOMPLISHED_SCHETZAP ON ISZL.T_SCHET_SLUCH_ACCOMPLISHED (SchetZap)
GO
