IF OBJECT_ID('PRC_FILIAL_FAT_RESSUPRIMENTO') IS NULL
BEGIN
CREATE TABLE [dbo].[PRC_FILIAL_FAT_RESSUPRIMENTO](
	[CD_EMP] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
	[CD_FILIAL_FATURAMENTO] [int] NULL,
	[CD_USU] [int] NULL,
	[DT_CAD] [datetime] NULL,
 CONSTRAINT [PK_PRC_FILIAL_FAT_RESSUPRIMENTO] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_FILIAL] 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].[PRC_FILIAL_FAT_RESSUPRIMENTO]  WITH CHECK ADD  CONSTRAINT [FK_PRC_FILIAL_FAT_RESSUPRIMENTO_PRC_FILIAL] FOREIGN KEY([CD_EMP], [CD_FILIAL])
REFERENCES [dbo].[PRC_FILIAL] ([CD_EMP], [CD_FILIAL])

ALTER TABLE [dbo].[PRC_FILIAL_FAT_RESSUPRIMENTO] CHECK CONSTRAINT [FK_PRC_FILIAL_FAT_RESSUPRIMENTO_PRC_FILIAL]
end

