Я бы порекомендовал другой способ разделения значений:
with cte as (
select id, account_number, plan,
convert(varchar(max), left(deposits, charindex(';', deposits + ';') - 1)) as deposit,
convert(varchar(max), left(tax2, charindex(';', tax2 + ';') - 1)) as tax1,
convert(varchar(max), left(tax2, charindex(';', tax2 + ';') - 1)) as tax2,
convert(varchar(max), stuff(deposits, 1, charindex(';', deposits + ';'), '')) as deposit_rest,
convert(varchar(max), stuff(tax1, 1, charindex(';', tax1 + ';'), '')) as tax1_rest,
convert(varchar(max), stuff(tax2, 1, charindex(';', tax2 + ';'), '')) as tax2_rest
from t
union all
select id, account_number, plan,
convert(varchar(max), left(deposit_rest, charindex(';', deposit_rest + ';') - 1)) as deposit,
convert(varchar(max), left(tax2_rest, charindex(';', tax2_rest + ';') - 1)) as tax1,
convert(varchar(max), left(tax2_rest, charindex(';', tax2_rest + ';') - 1)) as tax2,
convert(varchar(max), stuff(deposit_rest, 1, charindex(';', deposit_rest + ';'), '')) as deposit_rest,
convert(varchar(max), stuff(tax1_rest, 1, charindex(';', tax1_rest + ';'), '')) as tax1_rest,
convert(varchar(max), stuff(tax2_rest, 1, charindex(';', tax2_rest + ';'), '')) as tax2_rest
from cte
where deposit_rest <> ''
)
select *
from cte;
Здесь - это дБ <> скрипка.