alter VIEW vGetTaf_ID_Of_Bargeh AS select b.ID,isnull(b.Taf_ID_Bank,0) Taf_ID from Bargeh b where isnull(b.Taf_ID_Bank,0) > 0 union all select b.ID,isnull(b.Taf_ID_Ezafeh,0) Taf_ID from Bargeh b where isnull(b.Taf_ID_Ezafeh,0) > 0 union all select b.ID,isnull(b.Taf_ID_HazineVisitor,0) Taf_ID from Bargeh b where isnull(b.Taf_ID_HazineVisitor,0) > 0 union all select b.ID,isnull(b.Taf_ID_Moshtari,0) Taf_ID from Bargeh b where isnull(b.Taf_ID_Moshtari,0) > 0 union all select b.ID,isnull(b.Taf_ID_Sandoogh,0) Taf_ID from Bargeh b where isnull(b.Taf_ID_Sandoogh,0) > 0 union all select b.ID,isnull(b.Taf_ID_Takhfif,0) Taf_ID from Bargeh b where isnull(b.Taf_ID_Takhfif,0) > 0 union all select b.ID,isnull(b.Taf_ID_Visitor,0) Taf_ID from Bargeh b where isnull(b.Taf_ID_Visitor,0) > 0 union all select b.ID,isnull(bd.Taf_ID_ArzeshAfzoodeh,0) Taf_ID from Bargeh b inner join BargehDetail bd on bd.ID = bd.Bar_ID where isnull(bd.Taf_ID_ArzeshAfzoodeh,0) > 0 union all select b.ID,isnull(bd.Taf_ID_HazinehVisitor,0) Taf_ID from Bargeh b inner join BargehDetail bd on bd.ID = bd.Bar_ID where isnull(bd.Taf_ID_HazinehVisitor,0) > 0 union all select b.ID,isnull(bd.Taf_ID_Khadamat,0) Taf_ID from Bargeh b inner join BargehDetail bd on bd.ID = bd.Bar_ID where isnull(bd.Taf_ID_Khadamat,0) > 0 union all select b.ID,isnull(bd.Taf_ID_Takhfif,0) Taf_ID from Bargeh b inner join BargehDetail bd on bd.ID = bd.Bar_ID where isnull(bd.Taf_ID_Takhfif,0) > 0 union all select b.ID,isnull(bd.Taf_ID_Visitor,0) Taf_ID from Bargeh b inner join BargehDetail bd on bd.ID = bd.Bar_ID where isnull(bd.Taf_ID_Visitor,0) > 0