IF OBJECT_ID('EST_TRIB_ALIQ_MVA_PARAM') IS NULL
	BEGIN 
		CREATE TABLE [dbo].[EST_TRIB_ALIQ_MVA_PARAM](
			[CD_EMP] [int] NOT NULL,
			[CD_TBL_MVA] [int] NOT NULL,
			[FLAG_PERC_PMC_ST_CARGA_TRIB] [int] NOT NULL,
			[PERC_PMC_ST_CARGA_TRIB] MONEY NULL,	
		 CONSTRAINT [PK_EST_TRIB_ALIQ_MVA_PARAM] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_TBL_MVA] 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]

		

		SET ANSI_PADDING OFF
		

		ALTER TABLE [dbo].[EST_TRIB_ALIQ_MVA_PARAM]  WITH NOCHECK ADD  CONSTRAINT [FK_EST_TRIB_ALIQ_MVA_PARAM_EST_TRIB_ALIQ_MVA] FOREIGN KEY([CD_EMP], [CD_TBL_MVA])
		REFERENCES [dbo].[EST_TRIB_ALIQ_MVA] ([CD_EMP], [CD_TBL_MVA])
		ON UPDATE CASCADE
		ON DELETE CASCADE
		

		ALTER TABLE [dbo].[EST_TRIB_ALIQ_MVA_PARAM] CHECK CONSTRAINT [FK_EST_TRIB_ALIQ_MVA_PARAM_EST_TRIB_ALIQ_MVA]
		

		ALTER TABLE [dbo].[EST_TRIB_ALIQ_MVA_PARAM] ADD  CONSTRAINT [DF_EST_TRIB_ALIQ_MVA_PARAM_FLAG_PERC_PMC_ST_CARGA_TRIB]  DEFAULT ((0)) FOR [FLAG_PERC_PMC_ST_CARGA_TRIB]
		

		ALTER TABLE [dbo].[EST_TRIB_ALIQ_MVA_PARAM] ADD  CONSTRAINT [DF_EST_TRIB_ALIQ_MVA_PARAM_PERC_PMC_ST_CARGA_TRIB]  DEFAULT ((0)) FOR [PERC_PMC_ST_CARGA_TRIB]
		

	END