
/****** Object:  Table [dbo].[RC_CLI_CONV_EST_PROD_PRECO_CONV_PROD]    Script Date: 01/25/2012 09:41:21 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO](
	[CD_EMP] [int] NOT NULL,
	[CD_CONV] [int] NOT NULL,
	[CD_CTR] [int] NOT NULL,
	[CD_PLANO_VENDA] [int] NOT NULL,
 CONSTRAINT [PK_RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_CONV] ASC,
	[CD_CTR] ASC,
	[CD_PLANO_VENDA] 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].[RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO]  WITH CHECK ADD  CONSTRAINT [FK_RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO_EST_PROD_PRECO_CONV_DEPTO] FOREIGN KEY([CD_EMP], [CD_CTR])
REFERENCES [dbo].[EST_PROD_PRECO_CONV_DEPTO] ([CD_EMP], [CD_CTR])
ON UPDATE CASCADE
GO

ALTER TABLE [dbo].[RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO] CHECK CONSTRAINT [FK_RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO_EST_PROD_PRECO_CONV_DEPTO]
GO

ALTER TABLE [dbo].[RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO]  WITH CHECK ADD  CONSTRAINT [FK_RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO_GLB_PLANO_VENDA] FOREIGN KEY([CD_PLANO_VENDA])
REFERENCES [dbo].[GLB_PLANO_VENDA] ([CD_PLANO_VENDA])
ON UPDATE CASCADE
GO

ALTER TABLE [dbo].[RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO] CHECK CONSTRAINT [FK_RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO_GLB_PLANO_VENDA]
GO

ALTER TABLE [dbo].[RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO]  WITH CHECK ADD  CONSTRAINT [FK_RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO_RC_CLI_CONV] FOREIGN KEY([CD_EMP], [CD_CONV])
REFERENCES [dbo].[RC_CLI_CONV] ([CD_EMP], [CD_CONV])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO] CHECK CONSTRAINT [FK_RC_CLI_CONV_EST_PROD_PRECO_CONV_DEPTO_RC_CLI_CONV]
GO


