
/****** Object:  Table [dbo].[EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR]    Script Date: 02/14/2012 18:06:50 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR](
	[CD_EMP] [int] NOT NULL,
	[CD_CTR] [int] NOT NULL,
	[CD_PED_SOL] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
 CONSTRAINT [PK_EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_CTR] ASC,
	[CD_PED_SOL] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR]  WITH NOCHECK ADD  CONSTRAINT [FK_EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR_EST_PED_ELTR] FOREIGN KEY([CD_EMP], [CD_PED_SOL])
REFERENCES [dbo].[EST_PED_ELTR] ([CD_EMP], [CD_PED_SOL])
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR] CHECK CONSTRAINT [FK_EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR_EST_PED_ELTR]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR]  WITH NOCHECK ADD  CONSTRAINT [FK_EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR_EST_PED_ELTR_COT_COMPRA] FOREIGN KEY([CD_EMP], [CD_CTR])
REFERENCES [dbo].[EST_PED_ELTR_COT_COMPRA] ([CD_EMP], [CD_CTR])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR] CHECK CONSTRAINT [FK_EST_PED_ELTR_COT_COMPRA_EST_PED_ELTR_EST_PED_ELTR_COT_COMPRA]
GO


