IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_NF_ENT_IT_ESTORNO') AND NAME = 'TP_MOV')
BEGIN 
	ALTER TABLE EST_NF_ENT_IT_ESTORNO ADD TP_MOV INT NULL DEFAULT(0)
END 
go

IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_NF_ENT_IT_ESTORNO') AND NAME = 'DEST_ORIG')
BEGIN 
	ALTER TABLE EST_NF_ENT_IT_ESTORNO ADD DEST_ORIG INT NULL DEFAULT(0)
END 
go

IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_NF_ENT_IT_ESTORNO') AND NAME = 'ATU_EST')
BEGIN 
	ALTER TABLE EST_NF_ENT_IT_ESTORNO ADD ATU_EST INT NULL DEFAULT(0)
END 
go
  
IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_NF_ENT_IT_ESTORNO') AND NAME = 'CALC_CUSTO_MEDIO')
BEGIN 
	ALTER TABLE EST_NF_ENT_IT_ESTORNO ADD CALC_CUSTO_MEDIO INT NULL DEFAULT(0)
END 
go

IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_NF_ENT_IT_ESTORNO') AND NAME = 'FLAG_CUSTO_ZERO_ENT')
BEGIN 
	ALTER TABLE EST_NF_ENT_IT_ESTORNO ADD FLAG_CUSTO_ZERO_ENT INT NULL DEFAULT(0)
END 
go

IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_NF_ENT_IT_ESTORNO') AND NAME = 'CD_TRIB_FC')
BEGIN 
	ALTER TABLE EST_NF_ENT_IT_ESTORNO ADD CD_TRIB_FC VARCHAR (50) NULL DEFAULT('')
END 
go

IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_NF_ENT_IT_ESTORNO') AND NAME = 'RZ_FORN')
BEGIN 
	ALTER TABLE EST_NF_ENT_IT_ESTORNO ADD RZ_FORN VARCHAR (225) NULL DEFAULT('')
END 
go

IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_NF_ENT_IT_ESTORNO') AND NAME = 'CGC_CPF')
BEGIN 
	ALTER TABLE EST_NF_ENT_IT_ESTORNO ADD CGC_CPF VARCHAR (50) NULL DEFAULT('')
END 
go