

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

CREATE NONCLUSTERED INDEX [IX_CBTI_Cli_Venc_QA]
	ON [dbo].[Cbtes_Items] ([Id_Cliente],[Fecha_Venc],[Flag_QA],[Fecha_QA])
	INCLUDE ([Id_Producto],[Cantidad],[Serie])
GO


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


CREATE NONCLUSTERED INDEX [IX_CBTI_Cli_Flag_QA]
	ON [dbo].[Cbtes_Items] ([Id_Cliente],[Flag_QA])
	INCLUDE ([Id_Producto],[Cantidad],[Serie],[Fecha_Venc],[Fecha_QA])