IF OBJECT_ID('EST_PROD_PRECIFICACAO_META_MARGEM') IS NULL
	BEGIN 
		CREATE TABLE [dbo].[EST_PROD_PRECIFICACAO_META_MARGEM](
			[CD_EMP] [int] NOT NULL,
			[CD_GRUPO] [int] NOT NULL,
			[CD_USU] [int] NOT NULL,	
			[DT_CAD] [datetime] null,
			[DT_ULT_ALT] [datetime] null,
		 CONSTRAINT [PK_EST_PROD_PRECIFICACAO_META_MARGEM] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_GRUPO] 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_PRECIFICACAO_META_MARGEM]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_PRECIFICACAO_META_MARGEM_GLB_USU] FOREIGN KEY([CD_USU])
		REFERENCES [dbo].[GLB_USU] ([CD_USU])		

		ALTER TABLE [dbo].[EST_PROD_PRECIFICACAO_META_MARGEM] CHECK CONSTRAINT [FK_EST_PROD_PRECIFICACAO_META_MARGEM_GLB_USU]
 
	END