IF  EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[PDV_CUPOM_NAO_FISCAL_TEF_PEND]') AND name = N'<Name of Missing Index, sysname,>')
DROP INDEX [<Name of Missing Index, sysname,>] ON [dbo].[PDV_CUPOM_NAO_FISCAL_TEF_PEND]
GO

IF EXISTS (SELECT 1 FROM SYS.COLUMNS WHERE OBJECT_ID = OBJECT_ID('PDV_CUPOM_NAO_FISCAL_TEF_PEND') )
BEGIN
	IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[PDV_CUPOM_NAO_FISCAL_TEF_PEND]') AND name = N'IX_INTEGRA_FARMARCAS_EVENTOS')
CREATE NONCLUSTERED INDEX IX_PDV_CUPOM_NAO_FISCAL_TEF_PEND ON [dbo].[PDV_CUPOM_NAO_FISCAL_TEF_PEND]
(
	[CD_EMP] ASC,
	[CD_FILIAL] ASC,
	[CD_CTR] ASC
)
INCLUDE([NR_COO],[CD_RECTO_TEF]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
END


