IF NOT EXISTS(SELECT 1 fROM INFORMATION_SCHEMA.COLUMNS
					WHERE TABLE_NAME='PG_FORN_ORCAMENTO_COMPRAS' AND COLUMN_NAME='CD_BANDEIRA')
begin
DELETE FROM PG_FORN_ORCAMENTO_COMPRAS;
ALTER TABLE dbo.PG_FORN_ORCAMENTO_COMPRAS ADD
	CD_BANDEIRA int NOT NULL CONSTRAINT DF_PG_FORN_ORCAMENTO_COMPRAS_CD_BANDEIRA DEFAULT 0;

ALTER TABLE dbo.PG_FORN_ORCAMENTO_COMPRAS ADD CONSTRAINT
	FK_PG_FORN_ORCAMENTO_COMPRAS_PRC_BANDEIRA FOREIGN KEY
	(
	CD_BANDEIRA
	) REFERENCES dbo.PRC_BANDEIRA
	(
	CD_BANDEIRA
	) ON UPDATE  NO ACTION 
	 ON DELETE  NO ACTION;
end