IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_PED_ELTR_FORN_FALTAS') AND NAME = 'ORD_ENV')
BEGIN 
	ALTER TABLE EST_PED_ELTR_FORN_FALTAS  ADD ORD_ENV INT NOT NULL DEFAULT(1)
END 
GO

IF EXISTS(select 1 from sys.objects where name = 'PK_EST_PED_ELTR_FORN_FALTAS')
ALTER TABLE dbo.EST_PED_ELTR_FORN_FALTAS
	DROP CONSTRAINT PK_EST_PED_ELTR_FORN_FALTAS
GO 
ALTER TABLE dbo.EST_PED_ELTR_FORN_FALTAS ADD CONSTRAINT 
	PK_EST_PED_ELTR_FORN_FALTAS  PRIMARY KEY CLUSTERED 
	(	[CD_EMP] ASC,
		[CD_PED_SOL] ASC,
		[CD_FORN] ASC,
		[CD_PROD] ASC,
		[ORD_ENV] ASC 
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, 
	ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 