if not exists(select 1 from syscolumns where id = object_id('EST_NF_SAI_IT') and name = 'FLAG_EXCECAO_PIS_COFINS')
begin 
ALTER TABLE dbo.EST_NF_SAI_IT ADD
	FLAG_EXCECAO_PIS_COFINS int NULL 
	ALTER TABLE dbo.EST_NF_SAI_IT ADD CONSTRAINT
		DF_EST_NF_SAI_IT_FLAG_EXCECAO_PIS_COFINS DEFAULT 0 FOR FLAG_EXCECAO_PIS_COFINS
end
GO
if not exists(select 1 from syscolumns where id = object_id('EST_NF_ENT_IT') and name = 'FLAG_EXCECAO_PIS_COFINS')
begin 
	ALTER TABLE dbo.EST_NF_ENT_IT ADD
		FLAG_EXCECAO_PIS_COFINS int NULL 
	ALTER TABLE dbo.EST_NF_ENT_IT ADD CONSTRAINT
		DF_EST_NF_ENT_IT_FLAG_EXCECAO_PIS_COFINS DEFAULT 0 FOR FLAG_EXCECAO_PIS_COFINS
end
GO
if not exists(select 1 from syscolumns where id = object_id('PDV_VD_IT') and name = 'FLAG_EXCECAO_PIS_COFINS')
begin 
	ALTER TABLE dbo.PDV_VD_IT ADD
		FLAG_EXCECAO_PIS_COFINS int NULL 
	ALTER TABLE dbo.PDV_VD_IT ADD CONSTRAINT
		DF_PDV_VD_IT_FLAG_EXCECAO_PIS_COFINS DEFAULT 0 FOR FLAG_EXCECAO_PIS_COFINS
end
