IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EST_TRIB_ALIQ_MVA]')) 
	BEGIN 
		RETURN;
	END
ELSE
	BEGIN
		CREATE TABLE [dbo].[EST_TRIB_ALIQ_MVA](
			CD_EMP		INT NOT NULL,
			CD_TBL_MVA INT NOT NULL,
			DS_TBL_MVA VARCHAR(100),
			OBS_TBL_MVA VARCHAR(200),
			TP_SUBS INT,
			CD_USU INT,
			DT_CAD DATETIME, 
			DT_ULT_ALT DATETIME,
		 CONSTRAINT [PK_EST_TRIB_ALIQ_MVA] 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]
				
		ALTER TABLE [dbo].[EST_TRIB_ALIQ_MVA]  WITH NOCHECK ADD  CONSTRAINT [FK_EST_TRIB_ALIQ_MVA_GLB_USU] FOREIGN KEY([CD_USU])
		REFERENCES [dbo].[GLB_USU] ([CD_USU])		

		ALTER TABLE [dbo].[EST_TRIB_ALIQ_MVA] CHECK CONSTRAINT [FK_EST_TRIB_ALIQ_MVA_GLB_USU]
	
		ALTER TABLE [dbo].[EST_TRIB_ALIQ_MVA] ADD  CONSTRAINT [DF_EST_TRIB_ALIQ_MVA_TP_SUBS]  DEFAULT ((0)) FOR [TP_SUBS]		

	END
	
 