IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[HESAPISL]') AND name = N'IXM_HESAPISL_IPTAL_ONAYLI_TEKLIF')

CREATE NONCLUSTERED INDEX [IXM_HESAPISL_IPTAL_ONAYLI_TEKLIF]
ON [dbo].[HESAPISL] ([IPTAL],[ONAYLI],[TEKLIF])
INCLUDE ([HDOSYAID],[ITARIH],[ITEMID],[ISTBOLUMID],[ISTDRID],[UYGBOLUMID],[UYGDRID])
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]
GO

IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[HDOSYA]') AND name = N'IXM_HDOSYA_HKCARIID')

CREATE NONCLUSTERED INDEX [IXM_HDOSYA_HKCARIID]
ON [dbo].[HDOSYA] ([HKCARIID])
INCLUDE ([HKIMLIKID],[SNOTAKIPNO]) 
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]