IF EXISTS (
		SELECT *
		FROM SYS.INDEXES
		WHERE NAME = 'IX_EST_NF_ENT_DANFE_PROVISORIO_EST_NF_ENT_NF_ENT'
		)
BEGIN
	DROP INDEX IX_EST_NF_ENT_DANFE_PROVISORIO_EST_NF_ENT_NF_ENT ON [dbo].[EST_NF_ENT_DANFE_PROVISORIO_EST_NF_ENT]
END
GO

IF NOT EXISTS (
		SELECT *
		FROM SYS.INDEXES
		WHERE NAME = 'IX_EST_NF_ENT_DANFE_PROVISORIO_EST_NF_ENT_NF_ENT'
		)
BEGIN
	CREATE NONCLUSTERED INDEX [IX_EST_NF_ENT_DANFE_PROVISORIO_EST_NF_ENT_NF_ENT] ON [EST_NF_ENT_DANFE_PROVISORIO_EST_NF_ENT] (
		[CD_EMP] ASC
		,[CD_FILIAL] ASC
		,[CD_NF] ASC
		,[CD_CTR] ASC
		)
		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]
END
