IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE ID = OBJECT_ID('EST_TRIB_ALIQ_MVA') AND name = 'CD_REGIAO_FISCAL')
begin
	ALTER TABLE EST_TRIB_ALIQ_MVA ADD CD_REGIAO_FISCAL INT
	ALTER TABLE EST_TRIB_ALIQ_MVA ADD CONSTRAINT DF_EST_TRIB_ALIQ_MVA_CD_REGIAO_FISCAL DEFAULT 0 FOR CD_REGIAO_FISCAL 
end
GO
 
UPDATE EST_TRIB_ALIQ_MVA SET CD_REGIAO_FISCAL  = 0 
WHERE CD_REGIAO_FISCAL IS NULL												

GO


