 
/****** Object:  Table [dbo].[EST_PED_ELTR_COT_COMPRA_RET]    Script Date: 02/16/2012 16:27:00 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET](
	[CD_EMP] [int] NOT NULL,
	[CD_CTR] [int] NOT NULL,
	[CD_CTR_IT] [int] NOT NULL,
	[CD_PED_SOL] [int] NULL,
	[CD_FILIAL] [int] NULL,
	[CD_PROD] [int] NULL,
	[CD_FORN] [int] NULL,
	[VLR_PROD] [money] NULL,
	[VLR_REF] [money] NULL,
	[PERC_DESC] [money] NULL,
	[DT_CAD] [datetime] NULL,
	[CD_USU] [int] NULL,
 CONSTRAINT [PK_EST_PED_ELTR_COT_COMPRA_RET] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_CTR] ASC,
	[CD_CTR_IT] 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_RET]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_ELTR_COT_COMPRA_RET_EST_PED_ELTR_COT_COMPRA] FOREIGN KEY([CD_EMP], [CD_CTR])
REFERENCES [dbo].[EST_PED_ELTR_COT_COMPRA] ([CD_EMP], [CD_CTR])
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] CHECK CONSTRAINT [FK_EST_PED_ELTR_COT_COMPRA_RET_EST_PED_ELTR_COT_COMPRA]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_ELTR_COT_COMPRA_RET_EST_PROD] FOREIGN KEY([CD_EMP], [CD_PROD])
REFERENCES [dbo].[EST_PROD] ([CD_EMP], [CD_PROD])
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] CHECK CONSTRAINT [FK_EST_PED_ELTR_COT_COMPRA_RET_EST_PROD]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] ADD  CONSTRAINT [DF_EST_PED_ELTR_COT_COMPRA_RET_CD_EMP]  DEFAULT ((0)) FOR [CD_EMP]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] ADD  CONSTRAINT [DF_EST_PED_ELTR_COT_COMPRA_RET_CD_CTR]  DEFAULT ((0)) FOR [CD_CTR]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] ADD  CONSTRAINT [DF_EST_PED_ELTR_COT_COMPRA_RET_CD_FILIAL]  DEFAULT ((0)) FOR [CD_FILIAL]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] ADD  CONSTRAINT [DF_EST_PED_ELTR_COT_COMPRA_RET_CD_PROD]  DEFAULT ((0)) FOR [CD_PROD]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] ADD  CONSTRAINT [DF_EST_PED_ELTR_COT_COMPRA_RET_CD_FORN]  DEFAULT ((0)) FOR [CD_FORN]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] ADD  CONSTRAINT [DF_EST_PED_ELTR_COT_COMPRA_RET_VLR_PROD]  DEFAULT ((0)) FOR [VLR_PROD]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] ADD  CONSTRAINT [DF_EST_PED_ELTR_COT_COMPRA_RET_VLR_REF]  DEFAULT ((0)) FOR [VLR_REF]
GO

ALTER TABLE [dbo].[EST_PED_ELTR_COT_COMPRA_RET] ADD  CONSTRAINT [DF_EST_PED_ELTR_COT_COMPRA_RET_PERC_DESC]  DEFAULT ((0)) FOR [PERC_DESC]
GO


