IF OBJECT_ID('EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP')  IS NULL
	BEGIN 

		CREATE TABLE [dbo].[EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP](
			[CD_EMP] [int] NOT NULL,
			[CD_GRUPO] [int] NOT NULL,
			[CD_ADIC_MARKUP] [int] NOT NULL,
			[DS_ADIC_MARKUP] VARCHAR(50) ,
			[PERC_MARGEM] [money] NULL,
			[CD_USU] INT,
			[DT_CAD] DATETIME,
			[DT_ULT_ALT] DATETIME,
		 CONSTRAINT [PK_EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP_1] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_GRUPO] ASC,
			[CD_ADIC_MARKUP] ASC
		)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
		) ON [PRIMARY]

		 

		ALTER TABLE [dbo].[EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP] ADD  CONSTRAINT [DF_EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP_PERC_MARGEM]  DEFAULT ((0)) FOR [PERC_MARGEM]
		 

		ALTER TABLE [dbo].[EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP]  WITH CHECK ADD  CONSTRAINT [FK_EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP_EST_PRECIFICACAO_GRP_PRECO] FOREIGN KEY([CD_EMP], [CD_GRUPO])
		REFERENCES [dbo].[EST_PRECIFICACAO_GRP_PRECO] ([CD_EMP], [CD_GRUPO])
		ON DELETE CASCADE
		 

		ALTER TABLE [dbo].[EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP] CHECK CONSTRAINT [FK_EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP_EST_PRECIFICACAO_GRP_PRECO]

		 
		ALTER TABLE [dbo].[EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP]  WITH CHECK ADD  CONSTRAINT [FK_EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP_GLB_USU] FOREIGN KEY([CD_USU])
		REFERENCES [dbo].[GLB_USU] ([CD_USU])
		 

		ALTER TABLE [dbo].[EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP] CHECK CONSTRAINT [FK_EST_PRECIFICACAO_GRP_PRECO_ADIC_MARKUP_GLB_USU]
		 


	END