
/****** Object:  Table [dbo].[EST_PROD_PRECO_CONV_LINHA_EST_ARV_MERC_LINHA]    Script Date: 01/24/2012 09:34:52 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG](
	[CD_EMP] [int] NOT NULL,
	[CD_CTR] [int] NOT NULL,
	[CD_ARV_MERC_CATEGORIA] [int] NOT NULL,
	[PERC_DESC] [money] NULL,
	[PERC_DESC_CRM] [money] NULL,
 CONSTRAINT [PK_EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_CTR] ASC,
	[CD_ARV_MERC_CATEGORIA] 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_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG_EST_PROD_PRECO_CONV_CATEGORIA] FOREIGN KEY([CD_EMP], [CD_CTR])
REFERENCES [dbo].[EST_PROD_PRECO_CONV_CATEGORIA] ([CD_EMP], [CD_CTR])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG] CHECK CONSTRAINT [FK_EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG_EST_PROD_PRECO_CONV_CATEGORIA]
GO

ALTER TABLE [dbo].[EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG_EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG] FOREIGN KEY([CD_EMP], [CD_CTR], [CD_ARV_MERC_CATEGORIA])
REFERENCES [dbo].[EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG] ([CD_EMP], [CD_CTR], [CD_ARV_MERC_CATEGORIA])
GO

ALTER TABLE [dbo].[EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG] CHECK CONSTRAINT [FK_EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG_EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG]
GO

ALTER TABLE [dbo].[EST_PROD_PRECO_CONV_CATEG_EST_ARV_MERC_CATEG] ADD  CONSTRAINT [DF__EST_PROD___FLAG___1083B9BF]  DEFAULT ((0)) FOR [PERC_DESC_CRM]
GO


