
/****** Object:  Table [dbo].[EST_PED_CP_PARAM]    Script Date: 09/16/2013 15:22:22 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EST_PED_CP_ROTEIRO_CP_EST_PED_CP_PARAM](
	[CD_ROTEIRO] [int] NOT NULL,	
	[CD_ORD_ROTEIRO] [int] NOT NULL,
	[CD_EMP] [int] NOT NULL,
	[CD_PED_CP_PARAM] [int] NOT NULL,	
 CONSTRAINT [PK_EST_PED_CP_ROTEIRO_CP_EST_PED_CP_PARAM] PRIMARY KEY CLUSTERED 
(
	[CD_ROTEIRO] ASC,	
	[CD_ORD_ROTEIRO] 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_CP_ROTEIRO_CP_EST_PED_CP_PARAM]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_CP_ROTEIRO_CP_EST_PED_CP_PARAM_EST_PED_CP_ROTEIRO_CP] FOREIGN KEY([CD_ROTEIRO])
REFERENCES [dbo].[EST_PED_CP_ROTEIRO_CP] ([CD_ROTEIRO])
ON UPDATE CASCADE
ON DELETE CASCADE
GO


ALTER TABLE [dbo].[EST_PED_CP_ROTEIRO_CP_EST_PED_CP_PARAM]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_CP_ROTEIRO_CP_EST_PED_CP_PARAM_EST_PED_CP_PARAM] FOREIGN KEY([CD_EMP], [CD_PED_CP_PARAM])
REFERENCES [dbo].[EST_PED_CP_PARAM] ([CD_EMP], [CD_PED_CP_PARAM])
GO

ALTER TABLE [dbo].[EST_PED_CP_ROTEIRO_CP_EST_PED_CP_PARAM] CHECK CONSTRAINT [FK_EST_PED_CP_ROTEIRO_CP_EST_PED_CP_PARAM_EST_PED_CP_PARAM]
GO


