IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FATISL]') AND name = N'IX_FATISL_STOKID_FATID_SATIRIND_BFIYAT_FATISLID' AND is_unique = 0)
BEGIN
    CREATE NONCLUSTERED INDEX [IX_FATISL_STOKID_FATID_SATIRIND_BFIYAT_FATISLID] ON [dbo].[FATISL]
    (
	    [STOKID] ASC,
	    [FATID] ASC,
	    [SATIRIND] ASC,
	    [BFIYAT] ASC,
	    [FATISLID] ASC
    )
    INCLUDE ( 	
	    [ADET],
	    [SATIRIND2],
	    [SATIRINDT],
	    [SATISTID],
	    [KDV],
	    [IRSISLID],
	    [RGDEPOID]
	
	    ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = ON, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
END
ELSE
BEGIN
    CREATE NONCLUSTERED INDEX [IX_FATISL_STOKID_FATID_SATIRIND_BFIYAT_FATISLID] ON [dbo].[FATISL]
    (
	    [STOKID] ASC,
	    [FATID] ASC,
	    [SATIRIND] ASC,
	    [BFIYAT] ASC,
	    [FATISLID] ASC
    )
    INCLUDE ( 	
	    [ADET],
	    [SATIRIND2],
	    [SATIRINDT],
	    [SATISTID],
	    [KDV],
	    [IRSISLID],
	    [RGDEPOID]
	
	    ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
END