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

CREATE NONCLUSTERED INDEX [IXM_ITS_GTIN_XD_SUBEID]
ON [dbo].[ITS] ([GTIN],[SN],[XD],[SUBEID])
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].[DEPOFISISL]') AND 
name = N'IXM_DEPOFISISL_TEMPITSID')

CREATE NONCLUSTERED INDEX [IXM_DEPOFISISL_TEMPITSID]
ON [dbo].[DEPOFISISL] ([TEMPITSID])
INCLUDE ([DEPOFISID])
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].[DEPOFISISL]') AND 
name = N'IXM_DEPOFISISL_SN_GTIN_XD_CHDOSYAID')

CREATE NONCLUSTERED INDEX [IXM_DEPOFISISL_SN_GTIN_XD_CHDOSYAID]
ON [dbo].[DEPOFISISL] ([SN],[GTIN],[XD],[CHDOSYAID])
INCLUDE ([DEPOFISID],[STOKID])
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].[HMALZILAC]') AND 
name = N'IXM_HMALZILAC_SN_GTIN_XD')

CREATE NONCLUSTERED INDEX [IXM_HMALZILAC_SN_GTIN_XD]
ON [dbo].[HMALZILAC] ([SN],[GTIN],[XD])
INCLUDE ([HESAPISLID],[HDOSYAID])
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