if not exists (select * from sys.columns where object_id =object_id(N'EST_PROD')AND NAME ='FLAG_DESPESA_ACES')
BEGIN
ALTER TABLE dbo.EST_PROD ADD
 FLAG_DESPESA_ACES int NULL
ALTER TABLE EST_PROD ADD CONSTRAINT
 DF_FLAG_DESPESA_ACES DEFAULT 0 FOR FLAG_DESPESA_ACES
END
if not exists (select * from sys.columns where object_id =object_id(N'EST_PROD_PRC_BANDEIRA')AND NAME ='CD_ARV_MERC_PAPEL')
BEGIN
ALTER TABLE dbo.EST_PROD_PRC_BANDEIRA ADD
 CD_ARV_MERC_PAPEL int NULL
ALTER TABLE EST_PROD_PRC_BANDEIRA ADD CONSTRAINT
 DF_CD_ARV_MERC_PAPEL DEFAULT 0 FOR CD_ARV_MERC_PAPEL
END
if not exists (select * from sys.columns where object_id =object_id(N'EST_PROD_PRC_BANDEIRA')AND NAME ='FLAG_PROD_DESPESA_ACES')
BEGIN
ALTER TABLE dbo.EST_PROD_PRC_BANDEIRA ADD
 FLAG_PROD_DESPESA_ACES int NULL
ALTER TABLE EST_PROD_PRC_BANDEIRA ADD CONSTRAINT
 DF_FLAG_PROD_DESPESA_ACES DEFAULT 0 FOR FLAG_PROD_DESPESA_ACES
 END
 if not exists (select * from sys.columns where object_id =object_id(N'EST_PROD_PRC_BANDEIRA')AND NAME ='PROD_USO_CONT')
BEGIN
ALTER TABLE dbo.EST_PROD_PRC_BANDEIRA ADD
 PROD_USO_CONT int NULL
ALTER TABLE EST_PROD_PRC_BANDEIRA ADD CONSTRAINT
 DF_PROD_USO_CONT DEFAULT 0 FOR PROD_USO_CONT
END
 if not exists (select * from sys.columns where object_id =object_id(N'EST_PROD_PRC_BANDEIRA')AND NAME ='FLAG_PRODUTO_COTACAO')
BEGIN
ALTER TABLE dbo.EST_PROD_PRC_BANDEIRA ADD
 FLAG_PRODUTO_COTACAO int NULL
ALTER TABLE EST_PROD_PRC_BANDEIRA ADD CONSTRAINT
 DF_FLAG_PRODUTO_COTACAO DEFAULT 0 FOR FLAG_PRODUTO_COTACAO
END
if not exists (select * from sys.columns where object_id =object_id(N'EST_PROD_PRC_BANDEIRA')AND NAME ='FLAG_VENDA_PERIODICA')
BEGIN
ALTER TABLE dbo.EST_PROD_PRC_BANDEIRA ADD
 FLAG_VENDA_PERIODICA int NULL
ALTER TABLE EST_PROD_PRC_BANDEIRA ADD CONSTRAINT
 DF_FLAG_VENDA_PERIODICA DEFAULT 0 FOR FLAG_VENDA_PERIODICA
 END