IF IndexProperty(Object_Id('Cbtes_Items'), 'IX_CBTI_Flag_QA', 'IndexID') IS NOT NULL
	DROP INDEx IX_CBTI_Flag_QA ON Cbtes_Items
GO
CREATE NONCLUSTERED INDEX IX_CBTI_Flag_QA
	ON Cbtes_Items (Flag_QA)
	INCLUDE (Id_Producto,Cantidad)
GO


IF IndexProperty(Object_Id('Cbtes_Items'), 'IX_PorCliFQA', 'IndexID') IS NOT NULL
	DROP INDEX IX_PorCliFQA ON Cbtes_Items
GO


IF IndexProperty(Object_Id('Cbtes_Items'), 'IX_CBTI_PorCliFQA', 'IndexID') IS NOT NULL
	DROP INDEX IX_CBTI_PorCliFQA ON Cbtes_Items
GO


CREATE INDEX IX_CBTI_PorCliFQA ON Cbtes_Items (Id_Cliente,Fecha_QA)
INCLUDE (Id_Producto,Id_Trans,Item,Descripcion_Producto)
GO


