 IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[HYATIS]') AND name = N'IX_HYATIS_HESAPISLID_HYATISID_DURUM')
    BEGIN
	   CREATE NONCLUSTERED INDEX [IX_HYATIS_HESAPISLID_HYATISID_DURUM] ON [dbo].[HYATIS]
	   (
		   [HESAPISLID] ASC,
		   [HYATISID] ASC,
		   [DURUM] ASC
	   )
	   INCLUDE
	   (
		   HYYATISTIPI,OSPROTOKOLNO
	   )
	   WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = ON, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]

    END
    ELSE
    BEGIN
	   CREATE NONCLUSTERED INDEX [IX_HYATIS_HESAPISLID_HYATISID_DURUM] ON [dbo].[HYATIS]
	   (
			 [HESAPISLID] ASC,
			 [HYATISID] ASC,
			 [DURUM] ASC
	   )
	   INCLUDE
	   (
			 HYYATISTIPI,OSPROTOKOLNO
	   )
	   WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]

    END


