В одном из вариантов используется рекурсивный запрос:
with cte as (
select
from_currency,
to_currency,
exchange_rage,
startDate,
endDate,
startDate currentDate
from mytable t
union all
select
from_currency,
to_currency,
exchange_rage,
startDate,
endDate,
dateadd(day, 1, currentDate)
from cte
where currentDate < endDate
)
select from_currency, to_currency, exchange_rage, currentDate from cte
Если какой-либо из ваших периодов охватывает более 100 дней, вам необходимо добавить option(maxrecursion 0)
в конце запроса.