--
-- WARNING: This file was automatically generated by BX CodeGenerator
--

------------------------------------------------------------
-- Adding or fixing indexes on table DLN1
------------------------------------------------------------
DECLARE @keyID int
	IF EXISTS (SELECT 1 FROM sysindexes WHERE id = (SELECT id FROM sysobjects WHERE name = 'DLN1') and name = 'BXPIDX1') 
		DROP INDEX [BXPIDX1] ON [DLN1]
		CREATE INDEX
		[BXPIDX1] ON [DLN1](
			 PickIdNo
		)
GO
------------------------------------------------------------
-- Adding or fixing indexes on table OITL
------------------------------------------------------------
DECLARE @keyID int
	IF EXISTS (SELECT 1 FROM sysindexes WHERE id = (SELECT id FROM sysobjects WHERE name = 'OITL') and name = 'BXPIDX1') 
		DROP INDEX [BXPIDX1] ON [OITL]
		CREATE INDEX
		[BXPIDX1] ON [OITL](
			 ItemCode
			, LocCode
			, LogEntry
		)
GO
DECLARE @keyID int
	IF EXISTS (SELECT 1 FROM sysindexes WHERE id = (SELECT id FROM sysobjects WHERE name = 'OITL') and name = 'BXPIDX2') 
		DROP INDEX [BXPIDX2] ON [OITL]
		CREATE INDEX
		[BXPIDX2] ON [OITL](
			 ItemCode
			, ApplyLine
			, LocCode
		)
		INCLUDE (
			 LogEntry
			, ApplyEntry
			, ApplyType
			, AppDocNum
		)
GO
------------------------------------------------------------
-- Adding or fixing indexes on table RRR1
------------------------------------------------------------
DECLARE @keyID int
	IF EXISTS (SELECT 1 FROM sysindexes WHERE id = (SELECT id FROM sysobjects WHERE name = 'RRR1') and name = 'BXPIDX1') 
		DROP INDEX [BXPIDX1] ON [RRR1]
		CREATE INDEX
		[BXPIDX1] ON [RRR1](
			 PickIdNo
		)
GO
------------------------------------------------------------
-- Adding or fixing indexes on table ITL1
------------------------------------------------------------
DECLARE @keyID int
	IF EXISTS (SELECT 1 FROM sysindexes WHERE id = (SELECT id FROM sysobjects WHERE name = 'ITL1') and name = 'BXPIDX1') 
		DROP INDEX [BXPIDX1] ON [ITL1]
		CREATE INDEX
		[BXPIDX1] ON [ITL1](
			 SysNumber
			, LogEntry
		)
GO
------------------------------------------------------------
-- Adding or fixing indexes on table OITW
------------------------------------------------------------
DECLARE @keyID int
	IF EXISTS (SELECT 1 FROM sysindexes WHERE id = (SELECT id FROM sysobjects WHERE name = 'OITW') and name = 'BXPIDX1') 
		DROP INDEX [BXPIDX1] ON [OITW]
		CREATE INDEX
		[BXPIDX1] ON [OITW](
			 ItemCode
			, WhsCode
			, OnHand
		)
GO
