IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'EST_NF_ENT_DANFE_PROVISORIO_ITENS' AND COLUMN_NAME = 'CD_FILIAL_DANFE')
BEGIN 
    ALTER TABLE EST_NF_ENT_DANFE_PROVISORIO_ITENS ADD CD_FILIAL_DANFE INT NULL;
END


IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'EST_NF_ENT_DANFE_PROVISORIO_ITENS' AND COLUMN_NAME = 'CST_PIS')
BEGIN 
    ALTER TABLE EST_NF_ENT_DANFE_PROVISORIO_ITENS ADD CST_PIS INT NULL;
END


IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'EST_NF_ENT_DANFE_PROVISORIO_ITENS' AND COLUMN_NAME = 'CST_COFINS')
BEGIN 
    ALTER TABLE EST_NF_ENT_DANFE_PROVISORIO_ITENS ADD CST_COFINS INT NULL;
END