

if not exists(select 1 from syscolumns where id = object_id('EST_TRIB_ALIQ_MVA') and name = 'TP_TRANSA')
begin
	ALTER TABLE EST_TRIB_ALIQ_MVA ADD TP_TRANSA INT NULL

	ALTER TABLE EST_TRIB_ALIQ_MVA ADD CONSTRAINT  DF_EST_TRIB_ALIQ_MVA_TP_TRANSA DEFAULT (0) FOR TP_TRANSA
	
end

GO
UPDATE 	EST_TRIB_ALIQ_MVA SET TP_TRANSA = 2 WHERE TP_TRANSA IS NULL
