

/****** Object:  Table [dbo].[EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND]    Script Date: 06/24/2014 21:10:20 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND]') AND type in (N'U'))
DROP TABLE [dbo].[EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND]
GO


CREATE TABLE [dbo].[EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND](
	[CD_EMP] [int] NOT NULL,
	[CD_REGIAO_FISCAL] [int] NOT NULL,
	[CD_PROD] [int] NOT NULL,
	[CD_CTR] [int] NOT NULL,
	[DT_CAD] [datetime] NULL,
 CONSTRAINT [PK_EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_REGIAO_FISCAL] ASC,
	[CD_PROD] ASC,
	[CD_CTR] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

 

ALTER TABLE [dbo].[EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND_EST_PROD] FOREIGN KEY([CD_EMP], [CD_PROD])
REFERENCES [dbo].[EST_PROD] ([CD_EMP], [CD_PROD])
 

ALTER TABLE [dbo].[EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND] CHECK CONSTRAINT [FK_EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND_EST_PROD]
 

ALTER TABLE [dbo].[EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND_PRC_REGIAO_FISCAL] FOREIGN KEY([CD_REGIAO_FISCAL])
REFERENCES [dbo].[PRC_REGIAO_FISCAL] ([CD_REGIAO_FISCAL])
 

ALTER TABLE [dbo].[EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND] CHECK CONSTRAINT [FK_EST_PROD_PRC_REGIAO_FISCAL_TRIB_EST_PEND_PRC_REGIAO_FISCAL]
 
 